<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Client Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__crypto__cli__functions.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Client Functions<div class="ingroups"><a class="el" href="group__group__crypto.html">Crypto       (Cryptography)</a> &raquo; <a class="el" href="group__group__crypto__cli__srv.html">Client-Server Model</a> &raquo; <a class="el" href="group__group__crypto__cli__srv__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga79963cfa80b828a77a85bd8e144af2e1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga79963cfa80b828a77a85bd8e144af2e1">Cy_Crypto_Init</a> (<a class="el" href="structcy__stc__crypto__config__t.html">cy_stc_crypto_config_t</a> const *config, <a class="el" href="structcy__stc__crypto__context__t.html">cy_stc_crypto_context_t</a> *context)</td></tr>
<tr class="memdesc:ga79963cfa80b828a77a85bd8e144af2e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function initializes the Crypto context buffer and configures the Crypto driver.  <a href="#ga79963cfa80b828a77a85bd8e144af2e1">More...</a><br /></td></tr>
<tr class="separator:ga79963cfa80b828a77a85bd8e144af2e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5936961e6910bfe13dc643b418abbc51"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga5936961e6910bfe13dc643b418abbc51">Cy_Crypto_DeInit</a> (void)</td></tr>
<tr class="memdesc:ga5936961e6910bfe13dc643b418abbc51"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function de-initializes the Crypto driver.  <a href="#ga5936961e6910bfe13dc643b418abbc51">More...</a><br /></td></tr>
<tr class="separator:ga5936961e6910bfe13dc643b418abbc51"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga667e7a1cc511e30028e3c2848c17e26a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga667e7a1cc511e30028e3c2848c17e26a">Cy_Crypto_Enable</a> (void)</td></tr>
<tr class="memdesc:ga667e7a1cc511e30028e3c2848c17e26a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function enables (turns on) the Crypto hardware.  <a href="#ga667e7a1cc511e30028e3c2848c17e26a">More...</a><br /></td></tr>
<tr class="separator:ga667e7a1cc511e30028e3c2848c17e26a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab5087d676557ede15e376eddfb6836b0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gab5087d676557ede15e376eddfb6836b0">Cy_Crypto_Disable</a> (void)</td></tr>
<tr class="memdesc:gab5087d676557ede15e376eddfb6836b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function disables (turns off) the Crypto hardware.  <a href="#gab5087d676557ede15e376eddfb6836b0">More...</a><br /></td></tr>
<tr class="separator:gab5087d676557ede15e376eddfb6836b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac3fb202ea63ed0bec857424f8aac4b7e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a> (bool isBlocking)</td></tr>
<tr class="memdesc:gac3fb202ea63ed0bec857424f8aac4b7e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function waits or just checks (depending on the parameter) for the Crypto operation to complete.  <a href="#gac3fb202ea63ed0bec857424f8aac4b7e">More...</a><br /></td></tr>
<tr class="separator:gac3fb202ea63ed0bec857424f8aac4b7e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf448314d9c81b2ba38b14eef032998f2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gaf448314d9c81b2ba38b14eef032998f2">Cy_Crypto_GetErrorStatus</a> (<a class="el" href="structcy__stc__crypto__hw__error__t.html">cy_stc_crypto_hw_error_t</a> *hwErrorCause)</td></tr>
<tr class="memdesc:gaf448314d9c81b2ba38b14eef032998f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns a cause of a Crypto hardware error.  <a href="#gaf448314d9c81b2ba38b14eef032998f2">More...</a><br /></td></tr>
<tr class="separator:gaf448314d9c81b2ba38b14eef032998f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gace7c0bf28d501bba93e6ec2a2bd9a5ff"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gace7c0bf28d501bba93e6ec2a2bd9a5ff">Cy_Crypto_Prng_Init</a> (uint32_t lfsr32InitState, uint32_t lfsr31InitState, uint32_t lfsr29InitState, <a class="el" href="structcy__stc__crypto__context__prng__t.html">cy_stc_crypto_context_prng_t</a> *cfContext)</td></tr>
<tr class="memdesc:gace7c0bf28d501bba93e6ec2a2bd9a5ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function initializes parameters of the PRNG.  <a href="#gace7c0bf28d501bba93e6ec2a2bd9a5ff">More...</a><br /></td></tr>
<tr class="separator:gace7c0bf28d501bba93e6ec2a2bd9a5ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga093ac7a4aa184e35f840363b7e2e55c7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga093ac7a4aa184e35f840363b7e2e55c7">Cy_Crypto_Prng_Generate</a> (uint32_t max, uint32_t *randomNum, <a class="el" href="structcy__stc__crypto__context__prng__t.html">cy_stc_crypto_context_prng_t</a> *cfContext)</td></tr>
<tr class="memdesc:ga093ac7a4aa184e35f840363b7e2e55c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function generates 32-bit the Pseudo Random Number.  <a href="#ga093ac7a4aa184e35f840363b7e2e55c7">More...</a><br /></td></tr>
<tr class="separator:ga093ac7a4aa184e35f840363b7e2e55c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae157d02a1be9a43e944337dd816eb618"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gae157d02a1be9a43e944337dd816eb618">Cy_Crypto_Aes_Init</a> (uint32_t *key, <a class="el" href="group__group__crypto__enums.html#ga5402841d4798c0a82d41d8433c92b62f">cy_en_crypto_aes_key_length_t</a> keyLength, <a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> *cfContext)</td></tr>
<tr class="memdesc:gae157d02a1be9a43e944337dd816eb618"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function initializes the AES operation by setting key and key length.  <a href="#gae157d02a1be9a43e944337dd816eb618">More...</a><br /></td></tr>
<tr class="separator:gae157d02a1be9a43e944337dd816eb618"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaab0cf71455d23900d5d9b2606dd165c7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gaab0cf71455d23900d5d9b2606dd165c7">Cy_Crypto_Aes_Ecb_Run</a> (<a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a> dirMode, uint32_t *dstBlock, uint32_t *srcBlock, <a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> *cfContext)</td></tr>
<tr class="memdesc:gaab0cf71455d23900d5d9b2606dd165c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function performs AES operation on one 16-byte block (see <a class="el" href="group__group__crypto__cli__srv__macros.html#gab966285a569cc381f21ca7ebb9918128">CY_CRYPTO_AES_BLOCK_SIZE</a>).  <a href="#gaab0cf71455d23900d5d9b2606dd165c7">More...</a><br /></td></tr>
<tr class="separator:gaab0cf71455d23900d5d9b2606dd165c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa392c5512b5b1dd8809563e3a7becae3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gaa392c5512b5b1dd8809563e3a7becae3">Cy_Crypto_Aes_Cbc_Run</a> (<a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a> dirMode, uint32_t srcSize, uint32_t *ivPtr, uint32_t *dst, uint32_t *src, <a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> *cfContext)</td></tr>
<tr class="memdesc:gaa392c5512b5b1dd8809563e3a7becae3"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function performs AES operation on a plain text with Cipher Block Chaining (CBC).  <a href="#gaa392c5512b5b1dd8809563e3a7becae3">More...</a><br /></td></tr>
<tr class="separator:gaa392c5512b5b1dd8809563e3a7becae3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5d7cf59db1c7cb8ff970998733f0f9c0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga5d7cf59db1c7cb8ff970998733f0f9c0">Cy_Crypto_Aes_Cfb_Run</a> (<a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a> dirMode, uint32_t srcSize, uint32_t *ivPtr, uint32_t *dst, uint32_t *src, <a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> *cfContext)</td></tr>
<tr class="memdesc:ga5d7cf59db1c7cb8ff970998733f0f9c0"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function performs AES operation on a plain text with Cipher Feedback mode (CFB).  <a href="#ga5d7cf59db1c7cb8ff970998733f0f9c0">More...</a><br /></td></tr>
<tr class="separator:ga5d7cf59db1c7cb8ff970998733f0f9c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaccdf2614546b6c5cea2fcf18a456c28"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gaaccdf2614546b6c5cea2fcf18a456c28">Cy_Crypto_Aes_Ctr_Run</a> (<a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a> dirMode, uint32_t srcSize, uint32_t *srcOffset, uint32_t nonceCounter[<a class="el" href="group__group__crypto__cli__srv__macros.html#gab966285a569cc381f21ca7ebb9918128">CY_CRYPTO_AES_BLOCK_SIZE</a>/8u], uint32_t streamBlock[CY_CRYPTO_AES_BLOCK_SIZE/8u], uint32_t *dst, uint32_t *src, cy_stc_crypto_context_aes_t *cfContext)</td></tr>
<tr class="memdesc:gaaccdf2614546b6c5cea2fcf18a456c28"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function performs AES operation on a plain text with Cipher Block Counter mode (CTR).  <a href="#gaaccdf2614546b6c5cea2fcf18a456c28">More...</a><br /></td></tr>
<tr class="separator:gaaccdf2614546b6c5cea2fcf18a456c28"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadce7e0725bf4da6b0a597e60a615f5f8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gadce7e0725bf4da6b0a597e60a615f5f8">Cy_Crypto_Aes_Cmac_Run</a> (uint32_t *src, uint32_t srcSize, uint32_t *key, <a class="el" href="group__group__crypto__enums.html#ga5402841d4798c0a82d41d8433c92b62f">cy_en_crypto_aes_key_length_t</a> keyLength, uint32_t *cmacPtr, <a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> *cfContext)</td></tr>
<tr class="memdesc:gadce7e0725bf4da6b0a597e60a615f5f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function performs the cipher-block chaining-message authentication-code.  <a href="#gadce7e0725bf4da6b0a597e60a615f5f8">More...</a><br /></td></tr>
<tr class="separator:gadce7e0725bf4da6b0a597e60a615f5f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga81fe41f71b97c14e6a4aefcaa78e3378"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga81fe41f71b97c14e6a4aefcaa78e3378">Cy_Crypto_Sha_Run</a> (uint32_t *message, uint32_t messageSize, uint32_t *digest, <a class="el" href="group__group__crypto__enums.html#ga66ead9efce36e261e978cad722bf2dbb">cy_en_crypto_sha_mode_t</a> <a class="el" href="group__group__ipc__bt__data__structures.html#ga37e90f5e3bd99fac2021fb3a326607d4">mode</a>, <a class="el" href="structcy__stc__crypto__context__sha__t.html">cy_stc_crypto_context_sha_t</a> *cfContext)</td></tr>
<tr class="memdesc:ga81fe41f71b97c14e6a4aefcaa78e3378"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function performs the SHA Hash function.  <a href="#ga81fe41f71b97c14e6a4aefcaa78e3378">More...</a><br /></td></tr>
<tr class="separator:ga81fe41f71b97c14e6a4aefcaa78e3378"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga00f0ec4cac3b873b30ac5c4793f3c1d4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga00f0ec4cac3b873b30ac5c4793f3c1d4">Cy_Crypto_Hmac_Run</a> (uint32_t *hmac, uint32_t *message, uint32_t messageSize, uint32_t *key, uint32_t keyLength, <a class="el" href="group__group__crypto__enums.html#ga66ead9efce36e261e978cad722bf2dbb">cy_en_crypto_sha_mode_t</a> <a class="el" href="group__group__ipc__bt__data__structures.html#ga37e90f5e3bd99fac2021fb3a326607d4">mode</a>, <a class="el" href="structcy__stc__crypto__context__sha__t.html">cy_stc_crypto_context_sha_t</a> *cfContext)</td></tr>
<tr class="memdesc:ga00f0ec4cac3b873b30ac5c4793f3c1d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function performs HMAC calculation.  <a href="#ga00f0ec4cac3b873b30ac5c4793f3c1d4">More...</a><br /></td></tr>
<tr class="separator:ga00f0ec4cac3b873b30ac5c4793f3c1d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga50ce97ec1e079773c7ea32f4f94c7db3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga50ce97ec1e079773c7ea32f4f94c7db3">Cy_Crypto_Str_MemCpy</a> (void *dst, void const *src, uint16_t size, <a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> *cfContext)</td></tr>
<tr class="memdesc:ga50ce97ec1e079773c7ea32f4f94c7db3"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function copies a memory block.  <a href="#ga50ce97ec1e079773c7ea32f4f94c7db3">More...</a><br /></td></tr>
<tr class="separator:ga50ce97ec1e079773c7ea32f4f94c7db3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5a6972d7cac1b2af39017c3b814100df"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga5a6972d7cac1b2af39017c3b814100df">Cy_Crypto_Str_MemSet</a> (void *dst, uint8_t data, uint16_t size, <a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> *cfContext)</td></tr>
<tr class="memdesc:ga5a6972d7cac1b2af39017c3b814100df"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sets the memory block.  <a href="#ga5a6972d7cac1b2af39017c3b814100df">More...</a><br /></td></tr>
<tr class="separator:ga5a6972d7cac1b2af39017c3b814100df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1f6950833770e1f2b932f089fcd126b2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga1f6950833770e1f2b932f089fcd126b2">Cy_Crypto_Str_MemCmp</a> (void const *src0, void const *src1, uint16_t size, uint32_t *resultPtr, <a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> *cfContext)</td></tr>
<tr class="memdesc:ga1f6950833770e1f2b932f089fcd126b2"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function compares memory blocks.  <a href="#ga1f6950833770e1f2b932f089fcd126b2">More...</a><br /></td></tr>
<tr class="separator:ga1f6950833770e1f2b932f089fcd126b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga83173ba7fa2dd56777c23da6098f8372"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga83173ba7fa2dd56777c23da6098f8372">Cy_Crypto_Str_MemXor</a> (void const *src0, void const *src1, void *dst, uint16_t size, <a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> *cfContext)</td></tr>
<tr class="memdesc:ga83173ba7fa2dd56777c23da6098f8372"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function calculates the XOR of two memory blocks.  <a href="#ga83173ba7fa2dd56777c23da6098f8372">More...</a><br /></td></tr>
<tr class="separator:ga83173ba7fa2dd56777c23da6098f8372"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga833ab5adcd2c03da11cc883eb706ff20"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga833ab5adcd2c03da11cc883eb706ff20">Cy_Crypto_Crc_Init</a> (uint32_t polynomial, uint8_t dataReverse, uint8_t dataXor, uint8_t remReverse, uint32_t remXor, <a class="el" href="structcy__stc__crypto__context__crc__t.html">cy_stc_crypto_context_crc_t</a> *cfContext)</td></tr>
<tr class="memdesc:ga833ab5adcd2c03da11cc883eb706ff20"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function performs CRC initialization.  <a href="#ga833ab5adcd2c03da11cc883eb706ff20">More...</a><br /></td></tr>
<tr class="separator:ga833ab5adcd2c03da11cc883eb706ff20"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3c78c11d34fa63664275a7df5b35062c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga3c78c11d34fa63664275a7df5b35062c">Cy_Crypto_Crc_Run</a> (void *data, uint16_t dataSize, uint32_t *crc, uint32_t lfsrInitState, <a class="el" href="structcy__stc__crypto__context__crc__t.html">cy_stc_crypto_context_crc_t</a> *cfContext)</td></tr>
<tr class="memdesc:ga3c78c11d34fa63664275a7df5b35062c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function performs CRC calculation on a message.  <a href="#ga3c78c11d34fa63664275a7df5b35062c">More...</a><br /></td></tr>
<tr class="separator:ga3c78c11d34fa63664275a7df5b35062c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga69061dfb8a8ccd707edf8151e1427987"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga69061dfb8a8ccd707edf8151e1427987">Cy_Crypto_Trng_Generate</a> (uint32_t GAROPol, uint32_t FIROPol, uint32_t max, uint32_t *randomNum, <a class="el" href="structcy__stc__crypto__context__trng__t.html">cy_stc_crypto_context_trng_t</a> *cfContext)</td></tr>
<tr class="memdesc:ga69061dfb8a8ccd707edf8151e1427987"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function generates a 32-bit True Random Number.  <a href="#ga69061dfb8a8ccd707edf8151e1427987">More...</a><br /></td></tr>
<tr class="separator:ga69061dfb8a8ccd707edf8151e1427987"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab5ab6f272d15ebb2fb14000530b6d29a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gab5ab6f272d15ebb2fb14000530b6d29a">Cy_Crypto_Des_Run</a> (<a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a> dirMode, uint32_t *key, uint32_t *dstBlock, uint32_t *srcBlock, <a class="el" href="structcy__stc__crypto__context__des__t.html">cy_stc_crypto_context_des_t</a> *cfContext)</td></tr>
<tr class="memdesc:gab5ab6f272d15ebb2fb14000530b6d29a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function performs DES operation on a Single Block.  <a href="#gab5ab6f272d15ebb2fb14000530b6d29a">More...</a><br /></td></tr>
<tr class="separator:gab5ab6f272d15ebb2fb14000530b6d29a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga86c02f38711df37a1ca8f9b505ad5f2c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga86c02f38711df37a1ca8f9b505ad5f2c">Cy_Crypto_Tdes_Run</a> (<a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a> dirMode, uint32_t *key, uint32_t *dstBlock, uint32_t *srcBlock, <a class="el" href="structcy__stc__crypto__context__des__t.html">cy_stc_crypto_context_des_t</a> *cfContext)</td></tr>
<tr class="memdesc:ga86c02f38711df37a1ca8f9b505ad5f2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function performs the TDES operation on a single block.  <a href="#ga86c02f38711df37a1ca8f9b505ad5f2c">More...</a><br /></td></tr>
<tr class="separator:ga86c02f38711df37a1ca8f9b505ad5f2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7af64261d94fecab72944509ccafd3c1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga7af64261d94fecab72944509ccafd3c1">Cy_Crypto_GetMemBufAddress</a> (uint32_t **membufAddress, <a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> *cfContext)</td></tr>
<tr class="memdesc:ga7af64261d94fecab72944509ccafd3c1"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function gets an operation memory buffer location.  <a href="#ga7af64261d94fecab72944509ccafd3c1">More...</a><br /></td></tr>
<tr class="separator:ga7af64261d94fecab72944509ccafd3c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa3a3ecfb202af1b604b1fdf51e75aa55"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gaa3a3ecfb202af1b604b1fdf51e75aa55">Cy_Crypto_GetMemBufSize</a> (uint32_t *membufSize, <a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> *cfContext)</td></tr>
<tr class="memdesc:gaa3a3ecfb202af1b604b1fdf51e75aa55"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function gets an operation memory buffer size.  <a href="#gaa3a3ecfb202af1b604b1fdf51e75aa55">More...</a><br /></td></tr>
<tr class="separator:gaa3a3ecfb202af1b604b1fdf51e75aa55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaa1e1ff151ed92f21f876bb404be1b8f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gaaa1e1ff151ed92f21f876bb404be1b8f">Cy_Crypto_SetMemBufAddress</a> (uint32_t const *newMembufAddress, uint32_t newMembufSize, <a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> *cfContext)</td></tr>
<tr class="memdesc:gaaa1e1ff151ed92f21f876bb404be1b8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sets a new operation memory buffer.  <a href="#gaaa1e1ff151ed92f21f876bb404be1b8f">More...</a><br /></td></tr>
<tr class="separator:gaaa1e1ff151ed92f21f876bb404be1b8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac73a47f8656e1056686f461c68956fed"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gac73a47f8656e1056686f461c68956fed">Cy_Crypto_Rsa_Proc</a> (<a class="el" href="structcy__stc__crypto__rsa__pub__key__t.html">cy_stc_crypto_rsa_pub_key_t</a> const *pubKey, uint32_t const *message, uint32_t messageSize, uint32_t *processedMessage, <a class="el" href="structcy__stc__crypto__context__rsa__t.html">cy_stc_crypto_context_rsa_t</a> *cfContext)</td></tr>
<tr class="memdesc:gac73a47f8656e1056686f461c68956fed"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function calculates (m^e mod modulo) where m is Message (Signature), e - public exponent using a public key in the next representation, it contains: modulo, public exponent, coefficient for Barrett reduction, binary inverse of the modulo, and result of (2^moduloLength mod modulo).  <a href="#gac73a47f8656e1056686f461c68956fed">More...</a><br /></td></tr>
<tr class="separator:gac73a47f8656e1056686f461c68956fed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf7d03e6a13f42bae1fbbcf6c05730129"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gaf7d03e6a13f42bae1fbbcf6c05730129">Cy_Crypto_Rsa_CalcCoefs</a> (<a class="el" href="structcy__stc__crypto__rsa__pub__key__t.html">cy_stc_crypto_rsa_pub_key_t</a> const *pubKey, <a class="el" href="structcy__stc__crypto__context__rsa__t.html">cy_stc_crypto_context_rsa_t</a> *cfContext)</td></tr>
<tr class="memdesc:gaf7d03e6a13f42bae1fbbcf6c05730129"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function calculates constant coefficients (which is dependent only on modulo and independent on message).  <a href="#gaf7d03e6a13f42bae1fbbcf6c05730129">More...</a><br /></td></tr>
<tr class="separator:gaf7d03e6a13f42bae1fbbcf6c05730129"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaeb5b9b79cbdb1e4b45dce7a27e269b5c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gaeb5b9b79cbdb1e4b45dce7a27e269b5c">Cy_Crypto_Rsa_Verify</a> (<a class="el" href="group__group__crypto__enums.html#gaf08f93b8b21962a60f119157337b2113">cy_en_crypto_rsa_ver_result_t</a> *verResult, <a class="el" href="group__group__crypto__enums.html#ga66ead9efce36e261e978cad722bf2dbb">cy_en_crypto_sha_mode_t</a> digestType, uint32_t const *digest, uint32_t const *decryptedSignature, uint32_t decryptedSignatureLength, <a class="el" href="structcy__stc__crypto__context__rsa__ver__t.html">cy_stc_crypto_context_rsa_ver_t</a> *cfContext)</td></tr>
<tr class="memdesc:gaeb5b9b79cbdb1e4b45dce7a27e269b5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function does an RSA verification with checks for content, paddings, and signature format.  <a href="#gaeb5b9b79cbdb1e4b45dce7a27e269b5c">More...</a><br /></td></tr>
<tr class="separator:gaeb5b9b79cbdb1e4b45dce7a27e269b5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga82ae96bd17e206306bd8e7b5f09de17a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga82ae96bd17e206306bd8e7b5f09de17a">Cy_Crypto_ECDSA_SignHash</a> (const uint8_t *hash, uint32_t hashlen, uint8_t *sig, const <a class="el" href="structcy__stc__crypto__ecc__key.html">cy_stc_crypto_ecc_key</a> *key, const uint8_t *messageKey, <a class="el" href="structcy__stc__crypto__context__ecc__t.html">cy_stc_crypto_context_ecc_t</a> *cfContext)</td></tr>
<tr class="memdesc:ga82ae96bd17e206306bd8e7b5f09de17a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sign a message digest.  <a href="#ga82ae96bd17e206306bd8e7b5f09de17a">More...</a><br /></td></tr>
<tr class="separator:ga82ae96bd17e206306bd8e7b5f09de17a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga516a14dbdb8e2bd757311017e5a7cf20"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#ga516a14dbdb8e2bd757311017e5a7cf20">Cy_Crypto_ECDSA_VerifyHash</a> (const uint8_t *sig, const uint8_t *hash, uint32_t hashlen, uint8_t *stat, const <a class="el" href="structcy__stc__crypto__ecc__key.html">cy_stc_crypto_ecc_key</a> *key, <a class="el" href="structcy__stc__crypto__context__ecc__t.html">cy_stc_crypto_context_ecc_t</a> *cfContext)</td></tr>
<tr class="memdesc:ga516a14dbdb8e2bd757311017e5a7cf20"><td class="mdescLeft">&#160;</td><td class="mdescRight">Verify an ECC signature.  <a href="#ga516a14dbdb8e2bd757311017e5a7cf20">More...</a><br /></td></tr>
<tr class="separator:ga516a14dbdb8e2bd757311017e5a7cf20"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabd4ba58c8fef2e5dc952995774cfb760"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__cli__functions.html#gabd4ba58c8fef2e5dc952995774cfb760">Cy_Crypto_InvertEndianness</a> (void *inArrPtr, uint32_t byteSize)</td></tr>
<tr class="memdesc:gabd4ba58c8fef2e5dc952995774cfb760"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function reverts byte-array memory block, like:<br />
 inArr[0] &lt;&mdash;&gt; inArr[n]<br />
 inArr[1] &lt;&mdash;&gt; inArr[n-1]<br />
 inArr[2] &lt;&mdash;&gt; inArr[n-2]<br />
 ........................<br />
 inArr[n/2] &lt;&mdash;&gt; inArr[n/2-1]<br />
  <a href="#gabd4ba58c8fef2e5dc952995774cfb760">More...</a><br /></td></tr>
<tr class="separator:gabd4ba58c8fef2e5dc952995774cfb760"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga79963cfa80b828a77a85bd8e144af2e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga79963cfa80b828a77a85bd8e144af2e1">&#9670;&nbsp;</a></span>Cy_Crypto_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__config__t.html">cy_stc_crypto_config_t</a> const *&#160;</td>
          <td class="paramname"><em>config</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__t.html">cy_stc_crypto_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function initializes the Crypto context buffer and configures the Crypto driver. </p>
<p>Must be called at first.</p>
<p>To start working with Crypto methods after Crypto_Init(), call Crypto_Enable() to turn-on the Crypto Hardware.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">config</td><td>The pointer to the Crypto configuration structure.</td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__t.html">cy_stc_crypto_context_t</a> instance of structure that stores the Crypto driver common context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: Configure Server and Client as follows:</span></div><div class="line"><span class="comment">     * Server:</span></div><div class="line"><span class="comment">     *  - IPC channel for communication: 9</span></div><div class="line"><span class="comment">     *  - IPC interrupt structure used for new request notifications: 1</span></div><div class="line"><span class="comment">     *  - Data request handler: default</span></div><div class="line"><span class="comment">     *  - Hardware errors handler: default</span></div><div class="line"><span class="comment">     * Client:</span></div><div class="line"><span class="comment">     *  - IPC channel for communication: 9</span></div><div class="line"><span class="comment">     *  - IPC interrupt structure used for data ready notifications: 2</span></div><div class="line"><span class="comment">     *  - Data Complete callback: not used</span></div><div class="line"><span class="comment">     */</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define MY_CHAN_CRYPTO         (uint32_t)(9u)    </span><span class="comment">/* IPC data channel for the Crypto */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">    #define MY_INTR_CRYPTO_SRV     (uint32_t)(1u)    </span><span class="comment">/* IPC interrupt structure for the Crypto server */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">    #define MY_INTR_CRYPTO_CLI     (uint32_t)(2u)    </span><span class="comment">/* IPC interrupt structure for the Crypto client */</span><span class="preprocessor"></span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define MY_INTR_CRYPTO_SRV_MUX (IRQn_Type)(2u)   </span><span class="comment">/* CM0+ IPC interrupt mux number the Crypto server */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">    #define MY_INTR_CRYPTO_CLI_MUX (IRQn_Type)(3u)   </span><span class="comment">/* CM0+ IPC interrupt mux number the Crypto client */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">    #define MY_INTR_CRYPTO_ERR_MUX (IRQn_Type)(4u)   </span><span class="comment">/* CM0+ ERROR interrupt mux number the Crypto server */</span><span class="preprocessor"></span></div><div class="line"></div><div class="line">    <span class="keyword">const</span> <a class="code" href="structcy__stc__crypto__config__t.html">cy_stc_crypto_config_t</a> myCryptoConfig =</div><div class="line">    {</div><div class="line">        <span class="comment">/* .ipcChannel             */</span> MY_CHAN_CRYPTO,</div><div class="line">        <span class="comment">/* .acquireNotifierChannel */</span> MY_INTR_CRYPTO_SRV,</div><div class="line">        <span class="comment">/* .releaseNotifierChannel */</span> MY_INTR_CRYPTO_CLI,</div><div class="line"></div><div class="line">        <span class="comment">/* .releaseNotifierConfig */</span> {</div><div class="line"><span class="preprocessor">        #if (CY_CPU_CORTEX_M0P)</span></div><div class="line">            <span class="comment">/* .intrSrc            */</span> MY_INTR_CRYPTO_CLI_MUX,</div><div class="line">            <span class="comment">/* .cm0pSrc            */</span> cpuss_interrupts_ipc_2_IRQn, <span class="comment">/* depends on selected releaseNotifierChannel value */</span></div><div class="line"><span class="preprocessor">        #else</span></div><div class="line">            <span class="comment">/* .intrSrc            */</span> cpuss_interrupts_ipc_2_IRQn, <span class="comment">/* depends on selected releaseNotifierChannel value */</span></div><div class="line"><span class="preprocessor">        #endif</span></div><div class="line">            <span class="comment">/* .intrPriority       */</span> 2u,</div><div class="line">        },</div><div class="line"></div><div class="line">        <span class="comment">/* .userCompleteCallback   */</span> NULL,</div><div class="line">        <span class="comment">/* .userGetDataHandler     */</span> NULL,</div><div class="line">        <span class="comment">/* .userErrorHandler       */</span> NULL,</div><div class="line"></div><div class="line">        <span class="comment">/* .acquireNotifierConfig */</span> {</div><div class="line"><span class="preprocessor">        #if (CY_CPU_CORTEX_M0P)</span></div><div class="line">            <span class="comment">/* .intrSrc            */</span> MY_INTR_CRYPTO_SRV_MUX,      <span class="comment">/* to use with DeepSleep mode should be in DeepSleep capable muxer&#39;s range */</span></div><div class="line">            <span class="comment">/* .cm0pSrc            */</span> cpuss_interrupts_ipc_1_IRQn, <span class="comment">/* depends on selected acquireNotifierChannel value */</span></div><div class="line"><span class="preprocessor">        #else</span></div><div class="line">            <span class="comment">/* .intrSrc            */</span> cpuss_interrupts_ipc_1_IRQn, <span class="comment">/* depends on selected acquireNotifierChannel value */</span></div><div class="line"><span class="preprocessor">        #endif</span></div><div class="line">            <span class="comment">/* .intrPriority       */</span> 2u,</div><div class="line">        },</div><div class="line">        <span class="comment">/* .cryptoErrorIntrConfig */</span> {</div><div class="line"><span class="preprocessor">        #if (CY_CPU_CORTEX_M0P)</span></div><div class="line">            <span class="comment">/* .intrSrc            */</span> MY_INTR_CRYPTO_ERR_MUX,</div><div class="line">            <span class="comment">/* .cm0pSrc            */</span> cpuss_interrupt_crypto_IRQn,</div><div class="line"><span class="preprocessor">        #else</span></div><div class="line">            <span class="comment">/* .intrSrc            */</span> cpuss_interrupt_crypto_IRQn,</div><div class="line"><span class="preprocessor">        #endif</span></div><div class="line">            <span class="comment">/* .intrPriority       */</span> 2u,</div><div class="line">        }</div><div class="line">    };</div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__crypto__context__t.html">cy_stc_crypto_context_t</a>     myCryptoContext;</div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>       cryptoStatus;</div><div class="line"></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#ga79963cfa80b828a77a85bd8e144af2e1">Cy_Crypto_Init</a>(&amp;myCryptoConfig, &amp;myCryptoContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#ga667e7a1cc511e30028e3c2848c17e26a">Cy_Crypto_Enable</a>();</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga5936961e6910bfe13dc643b418abbc51"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5936961e6910bfe13dc643b418abbc51">&#9670;&nbsp;</a></span>Cy_Crypto_DeInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_DeInit </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function de-initializes the Crypto driver. </p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="ga667e7a1cc511e30028e3c2848c17e26a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga667e7a1cc511e30028e3c2848c17e26a">&#9670;&nbsp;</a></span>Cy_Crypto_Enable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Enable </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function enables (turns on) the Crypto hardware. </p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="gab5087d676557ede15e376eddfb6836b0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab5087d676557ede15e376eddfb6836b0">&#9670;&nbsp;</a></span>Cy_Crypto_Disable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Disable </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function disables (turns off) the Crypto hardware. </p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="gac3fb202ea63ed0bec857424f8aac4b7e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac3fb202ea63ed0bec857424f8aac4b7e">&#9670;&nbsp;</a></span>Cy_Crypto_Sync()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Sync </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>isBlocking</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function waits or just checks (depending on the parameter) for the Crypto operation to complete. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">isBlocking</td><td>Set whether Crypto_Sync is blocking: True - is blocking. False - is not blocking.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="gaf448314d9c81b2ba38b14eef032998f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf448314d9c81b2ba38b14eef032998f2">&#9670;&nbsp;</a></span>Cy_Crypto_GetErrorStatus()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_GetErrorStatus </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__hw__error__t.html">cy_stc_crypto_hw_error_t</a> *&#160;</td>
          <td class="paramname"><em>hwErrorCause</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns a cause of a Crypto hardware error. </p>
<p>It is independent of the Crypto previous state.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hwErrorCause</td><td><a class="el" href="structcy__stc__crypto__hw__error__t.html">cy_stc_crypto_hw_error_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="gace7c0bf28d501bba93e6ec2a2bd9a5ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gace7c0bf28d501bba93e6ec2a2bd9a5ff">&#9670;&nbsp;</a></span>Cy_Crypto_Prng_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Prng_Init </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>lfsr32InitState</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>lfsr31InitState</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>lfsr29InitState</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__prng__t.html">cy_stc_crypto_context_prng_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function initializes parameters of the PRNG. </p>
<p>Call to initialize this encryption technique before using any associated functions. You must initialize this technique again after using any other encryption technique. Invoking this function resets the pseudo random sequence.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lfsr32InitState</td><td>A non-zero seed value for the first LFSR. User selected.</td></tr>
    <tr><td class="paramname">lfsr31InitState</td><td>A non-zero seed value for the second LFSR. User selected.</td></tr>
    <tr><td class="paramname">lfsr29InitState</td><td>A non-zero seed value for the third LFSR. User selected.</td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__prng__t.html">cy_stc_crypto_context_prng_t</a> structure that stores the Crypto function context. <b>Must be 4-byte aligned.</b></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* Initialization seed values for Pseudo Random Generator */</span></div><div class="line"><span class="preprocessor">    #define LFSR32_INITSTATE      (0xd8959bc9)</span></div><div class="line"><span class="preprocessor">    #define LFSR31_INITSTATE      (0x2bb911f8)</span></div><div class="line"><span class="preprocessor">    #define LFSR29_INITSTATE      (0x060c31b7)</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define MAX_PRNG_VALUE        (255UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Generated Random Number */</span></div><div class="line">    uint32_t rndNum = 0;</div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__crypto__context__prng__t.html">cy_stc_crypto_context_prng_t</a>  cryptoPrngContext;</div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>         cryptoStatus;</div><div class="line"></div><div class="line">    <span class="comment">/* Initialize Pseudo Random Generator in Crypto Driver */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gace7c0bf28d501bba93e6ec2a2bd9a5ff">Cy_Crypto_Prng_Init</a>(</div><div class="line">                        LFSR32_INITSTATE,</div><div class="line">                        LFSR31_INITSTATE,</div><div class="line">                        LFSR29_INITSTATE, &amp;cryptoPrngContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Generate Pseudo Random number into rndNum variable */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#ga093ac7a4aa184e35f840363b7e2e55c7">Cy_Crypto_Prng_Generate</a>(MAX_PRNG_VALUE, &amp;rndNum, &amp;cryptoPrngContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Wait crypto become available */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a>(<a class="code" href="group__group__crypto__cli__srv__macros.html#ga7cad37b39669bf7ec2994103962c73ad">CY_CRYPTO_SYNC_BLOCKING</a>);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga093ac7a4aa184e35f840363b7e2e55c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga093ac7a4aa184e35f840363b7e2e55c7">&#9670;&nbsp;</a></span>Cy_Crypto_Prng_Generate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Prng_Generate </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>randomNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__prng__t.html">cy_stc_crypto_context_prng_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function generates 32-bit the Pseudo Random Number. </p>
<p>It depends on <a class="el" href="group__group__crypto__cli__functions.html#gace7c0bf28d501bba93e6ec2a2bd9a5ff">Cy_Crypto_Prng_Init</a> that should be called before.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">max</td><td>The maximum value of a generated random number.</td></tr>
    <tr><td class="paramname">randomNum</td><td>The pointer to a variable to store the generated pseudo random number. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__prng__t.html">cy_stc_crypto_context_prng_t</a> structure that stores the Crypto function context. <b>Must be 4-byte aligned.</b></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* Initialization seed values for Pseudo Random Generator */</span></div><div class="line"><span class="preprocessor">    #define LFSR32_INITSTATE      (0xd8959bc9)</span></div><div class="line"><span class="preprocessor">    #define LFSR31_INITSTATE      (0x2bb911f8)</span></div><div class="line"><span class="preprocessor">    #define LFSR29_INITSTATE      (0x060c31b7)</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define MAX_PRNG_VALUE        (255UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Generated Random Number */</span></div><div class="line">    uint32_t rndNum = 0;</div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__crypto__context__prng__t.html">cy_stc_crypto_context_prng_t</a>  cryptoPrngContext;</div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>         cryptoStatus;</div><div class="line"></div><div class="line">    <span class="comment">/* Initialize Pseudo Random Generator in Crypto Driver */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gace7c0bf28d501bba93e6ec2a2bd9a5ff">Cy_Crypto_Prng_Init</a>(</div><div class="line">                        LFSR32_INITSTATE,</div><div class="line">                        LFSR31_INITSTATE,</div><div class="line">                        LFSR29_INITSTATE, &amp;cryptoPrngContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Generate Pseudo Random number into rndNum variable */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#ga093ac7a4aa184e35f840363b7e2e55c7">Cy_Crypto_Prng_Generate</a>(MAX_PRNG_VALUE, &amp;rndNum, &amp;cryptoPrngContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Wait crypto become available */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a>(<a class="code" href="group__group__crypto__cli__srv__macros.html#ga7cad37b39669bf7ec2994103962c73ad">CY_CRYPTO_SYNC_BLOCKING</a>);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gae157d02a1be9a43e944337dd816eb618"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae157d02a1be9a43e944337dd816eb618">&#9670;&nbsp;</a></span>Cy_Crypto_Aes_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Aes_Init </td>
          <td>(</td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__crypto__enums.html#ga5402841d4798c0a82d41d8433c92b62f">cy_en_crypto_aes_key_length_t</a>&#160;</td>
          <td class="paramname"><em>keyLength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function initializes the AES operation by setting key and key length. </p>
<p>Call to initialize this encryption technique before using any associated functions. You must initialize this technique again after using any other encryption technique.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>The pointer to the encryption/decryption key. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">keyLength</td><td><a class="el" href="group__group__crypto__enums.html#ga5402841d4798c0a82d41d8433c92b62f">cy_en_crypto_aes_key_length_t</a></td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> structure that stores all internal variables the Crypto driver requires. <b>Must be 4-byte aligned.</b></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* All data arrays should be 4-byte aligned */</span></div><div class="line">    CY_ALIGN(4) uint8_t aesKey[<a class="code" href="group__group__crypto__cli__srv__macros.html#ga0170aa17289178203dcc2114a31c400e">CY_CRYPTO_AES_128_KEY_SIZE</a>] = {</div><div class="line">        0x2Bu, 0x7Eu, 0x15u, 0x16u, 0x28u, 0xAEu, 0xD2u, 0xA6u,</div><div class="line">        0xABu, 0xF7u, 0x15u, 0x88u, 0x09u, 0xCFu, 0x4Fu, 0x3Cu</div><div class="line">    };</div><div class="line"></div><div class="line">    CY_ALIGN(4) uint8_t aesEcbPlainText[<a class="code" href="group__group__crypto__cli__srv__macros.html#gab966285a569cc381f21ca7ebb9918128">CY_CRYPTO_AES_BLOCK_SIZE</a>]  = {</div><div class="line">        0x6Bu, 0xC0u, 0xBCu, 0xE1u, 0x2Au, 0x45u, 0x99u, 0x91u,</div><div class="line">        0xE1u, 0x34u, 0x74u, 0x1Au, 0x7Fu, 0x9Eu, 0x19u, 0x25u</div><div class="line">    };</div><div class="line"></div><div class="line">    CY_ALIGN(4) uint8_t aesEcbCipherText[<a class="code" href="group__group__crypto__cli__srv__macros.html#gab966285a569cc381f21ca7ebb9918128">CY_CRYPTO_AES_BLOCK_SIZE</a>] = {0};</div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a>   cryptoAesContext;</div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>         cryptoStatus;</div><div class="line"></div><div class="line">    <span class="comment">/* Initialize Crypto AES functionality  */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gae157d02a1be9a43e944337dd816eb618">Cy_Crypto_Aes_Init</a>(</div><div class="line">                        (uint32_t *)aesKey,</div><div class="line">                        <a class="code" href="group__group__crypto__enums.html#gga5402841d4798c0a82d41d8433c92b62fa1d7e508252e541450df0eb37f4c0bf6e">CY_CRYPTO_KEY_AES_128</a>,</div><div class="line">                        &amp;cryptoAesContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Wait crypto become available */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a>(<a class="code" href="group__group__crypto__cli__srv__macros.html#ga7cad37b39669bf7ec2994103962c73ad">CY_CRYPTO_SYNC_BLOCKING</a>);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Encrypt one block (16Bytes) by AES128 */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gaab0cf71455d23900d5d9b2606dd165c7">Cy_Crypto_Aes_Ecb_Run</a>(</div><div class="line">                        <a class="code" href="group__group__crypto__enums.html#ggae040fb530d4d110976bedfcdb7c8f09ca4b95ef1e3f73771b0c6a376c6d43e16d">CY_CRYPTO_ENCRYPT</a>,</div><div class="line">                        (uint32_t*)aesEcbCipherText,</div><div class="line">                        (uint32_t*)aesEcbPlainText,</div><div class="line">                        &amp;cryptoAesContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Wait crypto become available */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a>(<a class="code" href="group__group__crypto__cli__srv__macros.html#ga7cad37b39669bf7ec2994103962c73ad">CY_CRYPTO_SYNC_BLOCKING</a>);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gaab0cf71455d23900d5d9b2606dd165c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaab0cf71455d23900d5d9b2606dd165c7">&#9670;&nbsp;</a></span>Cy_Crypto_Aes_Ecb_Run()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Aes_Ecb_Run </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a>&#160;</td>
          <td class="paramname"><em>dirMode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>dstBlock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>srcBlock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function performs AES operation on one 16-byte block (see <a class="el" href="group__group__crypto__cli__srv__macros.html#gab966285a569cc381f21ca7ebb9918128">CY_CRYPTO_AES_BLOCK_SIZE</a>). </p>
<p>The AES key must be set before by invoking <a class="el" href="group__group__crypto__cli__functions.html#gae157d02a1be9a43e944337dd816eb618" title="This function initializes the AES operation by setting key and key length. ">Cy_Crypto_Aes_Init()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dirMode</td><td>Can be <a class="el" href="group__group__crypto__enums.html#ggae040fb530d4d110976bedfcdb7c8f09ca4b95ef1e3f73771b0c6a376c6d43e16d">CY_CRYPTO_ENCRYPT</a> or <a class="el" href="group__group__crypto__enums.html#ggae040fb530d4d110976bedfcdb7c8f09cac7ccc0aa22f73054744e87593deb77fd">CY_CRYPTO_DECRYPT</a> (<a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a>).</td></tr>
    <tr><td class="paramname">srcBlock</td><td>The pointer to a 16-byte source block. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">dstBlock</td><td>The pointer to a 16-byte destination cipher block. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> instance of structure that stores all AES internal variables. <b>Must be 4-byte aligned.</b></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* All data arrays should be 4-byte aligned */</span></div><div class="line">    CY_ALIGN(4) uint8_t aesKey[<a class="code" href="group__group__crypto__cli__srv__macros.html#ga0170aa17289178203dcc2114a31c400e">CY_CRYPTO_AES_128_KEY_SIZE</a>] = {</div><div class="line">        0x2Bu, 0x7Eu, 0x15u, 0x16u, 0x28u, 0xAEu, 0xD2u, 0xA6u,</div><div class="line">        0xABu, 0xF7u, 0x15u, 0x88u, 0x09u, 0xCFu, 0x4Fu, 0x3Cu</div><div class="line">    };</div><div class="line"></div><div class="line">    CY_ALIGN(4) uint8_t aesEcbPlainText[<a class="code" href="group__group__crypto__cli__srv__macros.html#gab966285a569cc381f21ca7ebb9918128">CY_CRYPTO_AES_BLOCK_SIZE</a>]  = {</div><div class="line">        0x6Bu, 0xC0u, 0xBCu, 0xE1u, 0x2Au, 0x45u, 0x99u, 0x91u,</div><div class="line">        0xE1u, 0x34u, 0x74u, 0x1Au, 0x7Fu, 0x9Eu, 0x19u, 0x25u</div><div class="line">    };</div><div class="line"></div><div class="line">    CY_ALIGN(4) uint8_t aesEcbCipherText[<a class="code" href="group__group__crypto__cli__srv__macros.html#gab966285a569cc381f21ca7ebb9918128">CY_CRYPTO_AES_BLOCK_SIZE</a>] = {0};</div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a>   cryptoAesContext;</div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>         cryptoStatus;</div><div class="line"></div><div class="line">    <span class="comment">/* Initialize Crypto AES functionality  */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gae157d02a1be9a43e944337dd816eb618">Cy_Crypto_Aes_Init</a>(</div><div class="line">                        (uint32_t *)aesKey,</div><div class="line">                        <a class="code" href="group__group__crypto__enums.html#gga5402841d4798c0a82d41d8433c92b62fa1d7e508252e541450df0eb37f4c0bf6e">CY_CRYPTO_KEY_AES_128</a>,</div><div class="line">                        &amp;cryptoAesContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Wait crypto become available */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a>(<a class="code" href="group__group__crypto__cli__srv__macros.html#ga7cad37b39669bf7ec2994103962c73ad">CY_CRYPTO_SYNC_BLOCKING</a>);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Encrypt one block (16Bytes) by AES128 */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gaab0cf71455d23900d5d9b2606dd165c7">Cy_Crypto_Aes_Ecb_Run</a>(</div><div class="line">                        <a class="code" href="group__group__crypto__enums.html#ggae040fb530d4d110976bedfcdb7c8f09ca4b95ef1e3f73771b0c6a376c6d43e16d">CY_CRYPTO_ENCRYPT</a>,</div><div class="line">                        (uint32_t*)aesEcbCipherText,</div><div class="line">                        (uint32_t*)aesEcbPlainText,</div><div class="line">                        &amp;cryptoAesContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Wait crypto become available */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a>(<a class="code" href="group__group__crypto__cli__srv__macros.html#ga7cad37b39669bf7ec2994103962c73ad">CY_CRYPTO_SYNC_BLOCKING</a>);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gaa392c5512b5b1dd8809563e3a7becae3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa392c5512b5b1dd8809563e3a7becae3">&#9670;&nbsp;</a></span>Cy_Crypto_Aes_Cbc_Run()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Aes_Cbc_Run </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a>&#160;</td>
          <td class="paramname"><em>dirMode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>srcSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>ivPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function performs AES operation on a plain text with Cipher Block Chaining (CBC). </p>
<p>The key must be set before by invoking <a class="el" href="group__group__crypto__cli__functions.html#gae157d02a1be9a43e944337dd816eb618" title="This function initializes the AES operation by setting key and key length. ">Cy_Crypto_Aes_Init()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dirMode</td><td>Can be <a class="el" href="group__group__crypto__enums.html#ggae040fb530d4d110976bedfcdb7c8f09ca4b95ef1e3f73771b0c6a376c6d43e16d">CY_CRYPTO_ENCRYPT</a> or <a class="el" href="group__group__crypto__enums.html#ggae040fb530d4d110976bedfcdb7c8f09cac7ccc0aa22f73054744e87593deb77fd">CY_CRYPTO_DECRYPT</a> (<a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a>)</td></tr>
    <tr><td class="paramname">srcSize</td><td>The size of the source plain text.</td></tr>
    <tr><td class="paramname">ivPtr</td><td>The pointer to the initial vector. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">dst</td><td>The pointer to a destination cipher text. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">src</td><td>The pointer to a source plain text. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> structure that stores all internal variables the Crypto driver requires. <b>Must be 4-byte aligned.</b></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="ga5d7cf59db1c7cb8ff970998733f0f9c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5d7cf59db1c7cb8ff970998733f0f9c0">&#9670;&nbsp;</a></span>Cy_Crypto_Aes_Cfb_Run()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Aes_Cfb_Run </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a>&#160;</td>
          <td class="paramname"><em>dirMode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>srcSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>ivPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function performs AES operation on a plain text with Cipher Feedback mode (CFB). </p>
<p>The key must be set before by invoking <a class="el" href="group__group__crypto__cli__functions.html#gae157d02a1be9a43e944337dd816eb618" title="This function initializes the AES operation by setting key and key length. ">Cy_Crypto_Aes_Init()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dirMode</td><td>Can be <a class="el" href="group__group__crypto__enums.html#ggae040fb530d4d110976bedfcdb7c8f09ca4b95ef1e3f73771b0c6a376c6d43e16d">CY_CRYPTO_ENCRYPT</a> or <a class="el" href="group__group__crypto__enums.html#ggae040fb530d4d110976bedfcdb7c8f09cac7ccc0aa22f73054744e87593deb77fd">CY_CRYPTO_DECRYPT</a> (<a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a>)</td></tr>
    <tr><td class="paramname">srcSize</td><td>The size of the source plain text.</td></tr>
    <tr><td class="paramname">ivPtr</td><td>The pointer to the initial vector. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">dst</td><td>The pointer to the destination cipher text. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">src</td><td>The pointer to the source plain text. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> structure that stores all internal variables the Crypto driver requires. <b>Must be 4-byte aligned.</b></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="gaaccdf2614546b6c5cea2fcf18a456c28"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaccdf2614546b6c5cea2fcf18a456c28">&#9670;&nbsp;</a></span>Cy_Crypto_Aes_Ctr_Run()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Aes_Ctr_Run </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a>&#160;</td>
          <td class="paramname"><em>dirMode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>srcSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>srcOffset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>nonceCounter</em>[CY_CRYPTO_AES_BLOCK_SIZE/8u], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>streamBlock</em>[CY_CRYPTO_AES_BLOCK_SIZE/8u], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function performs AES operation on a plain text with Cipher Block Counter mode (CTR). </p>
<p>NOTE: preparation of the unique nonceCounter for each block is the user's responsibility. This function is dependent on the key being set before invoking <a class="el" href="group__group__crypto__cli__functions.html#gae157d02a1be9a43e944337dd816eb618">Cy_Crypto_Aes_Init()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dirMode</td><td>Can be <a class="el" href="group__group__crypto__enums.html#ggae040fb530d4d110976bedfcdb7c8f09ca4b95ef1e3f73771b0c6a376c6d43e16d">CY_CRYPTO_ENCRYPT</a> or <a class="el" href="group__group__crypto__enums.html#ggae040fb530d4d110976bedfcdb7c8f09cac7ccc0aa22f73054744e87593deb77fd">CY_CRYPTO_DECRYPT</a> (<a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a>)</td></tr>
    <tr><td class="paramname">srcSize</td><td>The size of a source plain text.</td></tr>
    <tr><td class="paramname">srcOffset</td><td>The size of an offset within the current block stream for resuming within the current cipher stream.</td></tr>
    <tr><td class="paramname">nonceCounter</td><td>The 128-bit nonce and counter. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">streamBlock</td><td>The saved stream-block for resuming. Is over-written by the function. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">dst</td><td>The pointer to the destination cipher text. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">src</td><td>The pointer to the source plain text. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> structure that stores all internal variables the Crypto driver requires. <b>Must be 4-byte aligned.</b></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="gadce7e0725bf4da6b0a597e60a615f5f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadce7e0725bf4da6b0a597e60a615f5f8">&#9670;&nbsp;</a></span>Cy_Crypto_Aes_Cmac_Run()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Aes_Cmac_Run </td>
          <td>(</td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>srcSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__crypto__enums.html#ga5402841d4798c0a82d41d8433c92b62f">cy_en_crypto_aes_key_length_t</a>&#160;</td>
          <td class="paramname"><em>keyLength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>cmacPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function performs the cipher-block chaining-message authentication-code. </p>
<p>There is no Init function. Provide the required parameters and the pointer to the context structure when making this function call.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>The pointer to the source plain text. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">srcSize</td><td>The size of a source plain text.</td></tr>
    <tr><td class="paramname">key</td><td>The pointer to the encryption key. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">keyLength</td><td><a class="el" href="group__group__crypto__enums.html#ga5402841d4798c0a82d41d8433c92b62f">cy_en_crypto_aes_key_length_t</a></td></tr>
    <tr><td class="paramname">cmacPtr</td><td>The pointer to the calculated CMAC. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a> structure that stores all internal variables the Crypto driver requires.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* All data arrays should be 4-byte aligned */</span></div><div class="line">    CY_ALIGN(4) uint8_t cmacKey[<a class="code" href="group__group__crypto__cli__srv__macros.html#ga0b49d7f139227541dbc20bcd2a1867a4">CY_CRYPTO_AES_256_KEY_SIZE</a>] =</div><div class="line">    {</div><div class="line">        0x60u, 0x3Du, 0xEBu, 0x10u, 0x15u, 0xCAu, 0x71u, 0xBEu,</div><div class="line">        0x2Bu, 0x73u, 0xAEu, 0xF0u, 0x85u, 0x7Du, 0x77u, 0x81u,</div><div class="line">        0x1Fu, 0x35u, 0x2Cu, 0x07u, 0x3Bu, 0x61u, 0x08u, 0xD7u,</div><div class="line">        0x2Du, 0x98u, 0x10u, 0xA3u, 0x09u, 0x14u, 0xDFu, 0xF4u</div><div class="line">    };</div><div class="line"></div><div class="line">    CY_ALIGN(4) uint8_t cmac256PlainText[16]  =</div><div class="line">    {</div><div class="line">        0x6Bu, 0xC1u, 0xBEu, 0xE2u, 0x2Eu, 0x40u, 0x9Fu, 0x96u,</div><div class="line">        0xE9u, 0x3Du, 0x7Eu, 0x11u, 0x73u, 0x93u, 0x17u, 0x2Au</div><div class="line">    };</div><div class="line"></div><div class="line">    <span class="comment">/* Calculated CMAC */</span></div><div class="line">    CY_ALIGN(4) uint8_t cmac[<a class="code" href="group__group__crypto__cli__srv__macros.html#gab966285a569cc381f21ca7ebb9918128">CY_CRYPTO_AES_BLOCK_SIZE</a>] = {0};</div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__crypto__context__aes__t.html">cy_stc_crypto_context_aes_t</a>   cryptoAesContext;</div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>         cryptoStatus;</div><div class="line"></div><div class="line">    <span class="comment">/* CMAC from the text message using AES-256 */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gadce7e0725bf4da6b0a597e60a615f5f8">Cy_Crypto_Aes_Cmac_Run</a>(</div><div class="line">                        (uint32_t *)cmac256PlainText,</div><div class="line">                        <span class="keyword">sizeof</span>(cmac256PlainText),</div><div class="line">                        (uint32_t *)cmacKey,</div><div class="line">                        <a class="code" href="group__group__crypto__enums.html#gga5402841d4798c0a82d41d8433c92b62fa3b323f55c81fca9b412fea5ed28bcb30">CY_CRYPTO_KEY_AES_256</a>,</div><div class="line">                        (uint32_t *)cmac,</div><div class="line">                        &amp;cryptoAesContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Wait crypto become available */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a>(<a class="code" href="group__group__crypto__cli__srv__macros.html#ga7cad37b39669bf7ec2994103962c73ad">CY_CRYPTO_SYNC_BLOCKING</a>);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga81fe41f71b97c14e6a4aefcaa78e3378"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga81fe41f71b97c14e6a4aefcaa78e3378">&#9670;&nbsp;</a></span>Cy_Crypto_Sha_Run()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Sha_Run </td>
          <td>(</td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>message</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>messageSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>digest</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__crypto__enums.html#ga66ead9efce36e261e978cad722bf2dbb">cy_en_crypto_sha_mode_t</a>&#160;</td>
          <td class="paramname"><em>mode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__sha__t.html">cy_stc_crypto_context_sha_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function performs the SHA Hash function. </p>
<p>There is no Init function. Provide the required parameters and the pointer to the context structure when making this function call. It is independent of the previous Crypto state because it already contains preparation, calculation, and finalization steps.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mode</td><td><a class="el" href="group__group__crypto__enums.html#ga66ead9efce36e261e978cad722bf2dbb">cy_en_crypto_sha_mode_t</a></td></tr>
    <tr><td class="paramname">message</td><td>The pointer to a message whose hash value is being computed. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">messageSize</td><td>The size of a message.</td></tr>
    <tr><td class="paramname">digest</td><td>The pointer to the hash digest. The hash size depends on the selected SHA mode (from 20 to 64 bytes). <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">cfContext</td><td>the pointer to the <a class="el" href="structcy__stc__crypto__context__sha__t.html">cy_stc_crypto_context_sha_t</a> structure that stores all internal variables for Crypto driver.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* All data arrays should be 4-byte aligned */</span></div><div class="line">    <span class="comment">/* Message is: &quot;abc&quot; */</span></div><div class="line">    CY_ALIGN(4) uint8_t sha256PlainText_1[3]  = &quot;abc&quot;;</div><div class="line"></div><div class="line">    <span class="comment">/* Calculated SHA-256 digest */</span></div><div class="line">    CY_ALIGN(4) uint8_t sha256Digest[<a class="code" href="group__group__crypto__cli__srv__macros.html#ga82ff1a7671e4f0cf2026cbda5ef7e12a">CY_CRYPTO_SHA256_DIGEST_SIZE</a>] = {0};</div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__crypto__context__sha__t.html">cy_stc_crypto_context_sha_t</a>   cryptoShaContext;</div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>         cryptoStatus;</div><div class="line"></div><div class="line">    <span class="comment">/* Hash the message by SHA256 */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#ga81fe41f71b97c14e6a4aefcaa78e3378">Cy_Crypto_Sha_Run</a>(</div><div class="line">                        (uint32_t *)sha256PlainText_1,</div><div class="line">                        <span class="keyword">sizeof</span>(sha256PlainText_1),</div><div class="line">                        (uint32_t *)sha256Digest,</div><div class="line">                        <a class="code" href="group__group__crypto__enums.html#gga66ead9efce36e261e978cad722bf2dbba2212390919051b39d22d567c508c6d1f">CY_CRYPTO_MODE_SHA256</a>,</div><div class="line">                        &amp;cryptoShaContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Wait crypto become available */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a>(<a class="code" href="group__group__crypto__cli__srv__macros.html#ga7cad37b39669bf7ec2994103962c73ad">CY_CRYPTO_SYNC_BLOCKING</a>);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga00f0ec4cac3b873b30ac5c4793f3c1d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga00f0ec4cac3b873b30ac5c4793f3c1d4">&#9670;&nbsp;</a></span>Cy_Crypto_Hmac_Run()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Hmac_Run </td>
          <td>(</td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>hmac</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>message</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>messageSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>keyLength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__crypto__enums.html#ga66ead9efce36e261e978cad722bf2dbb">cy_en_crypto_sha_mode_t</a>&#160;</td>
          <td class="paramname"><em>mode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__sha__t.html">cy_stc_crypto_context_sha_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function performs HMAC calculation. </p>
<p>There is no Init function. Provide the required parameters and the pointer to the context structure when making this function call. It is independent of the previous Crypto state because it already contains preparation, calculation, and finalization steps.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hmac</td><td>The pointer to the calculated HMAC. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">message</td><td>The pointer to a message whose hash value is being computed. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">messageSize</td><td>The size of a message.</td></tr>
    <tr><td class="paramname">key</td><td>The pointer to the key. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">keyLength</td><td>The length of the key.</td></tr>
    <tr><td class="paramname">mode</td><td><a class="el" href="group__group__crypto__enums.html#ga66ead9efce36e261e978cad722bf2dbb">cy_en_crypto_sha_mode_t</a></td></tr>
    <tr><td class="paramname">cfContext</td><td>the pointer to the <a class="el" href="structcy__stc__crypto__context__sha__t.html">cy_stc_crypto_context_sha_t</a> structure that stores all internal variables for the Crypto driver.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* All data arrays should be 4-byte aligned */</span></div><div class="line">    CY_ALIGN(4) uint8_t hmac256Key[32] =</div><div class="line">    {</div><div class="line">        0x00u, 0x01u, 0x02u, 0x03u, 0x04u, 0x05u, 0x06u, 0x07u,</div><div class="line">        0x08u, 0x09u, 0x0Au, 0x0Bu, 0x0Cu, 0x0Du, 0x0Eu, 0x0Fu,</div><div class="line">        0x10u, 0x11u, 0x12u, 0x13u, 0x14u, 0x15u, 0x16u, 0x17u,</div><div class="line">        0x18u, 0x19u, 0x1Au, 0x1Bu, 0x1Cu, 0x1Du, 0x1Eu, 0x1Fu</div><div class="line">    };</div><div class="line"></div><div class="line">    CY_ALIGN(4) uint8_t hmac256PlainText[34]  =</div><div class="line">    {</div><div class="line">        0x53u, 0x61u,</div><div class="line">        0x6Du, 0x70u, 0x6Cu, 0x65u, 0x20u, 0x6Du, 0x65u, 0x73u,</div><div class="line">        0x73u, 0x61u, 0x67u, 0x65u, 0x20u, 0x66u, 0x6Fu, 0x72u,</div><div class="line">        0x20u, 0x6Bu, 0x65u, 0x79u, 0x6Cu, 0x65u, 0x6Eu, 0x3Cu,</div><div class="line">        0x62u, 0x6Cu, 0x6Fu, 0x63u, 0x6Bu, 0x6Cu, 0x65u, 0x6Eu</div><div class="line">    };</div><div class="line"></div><div class="line">    <span class="comment">/* Calculated HMAC */</span></div><div class="line">    CY_ALIGN(4) uint8_t hmac256[<a class="code" href="group__group__crypto__cli__srv__macros.html#ga82ff1a7671e4f0cf2026cbda5ef7e12a">CY_CRYPTO_SHA256_DIGEST_SIZE</a>] = {0};</div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__crypto__context__sha__t.html">cy_stc_crypto_context_sha_t</a>   cryptoShaContext;</div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>         cryptoStatus;</div><div class="line"></div><div class="line">    <span class="comment">/* HMAC from the text message using SHA256 */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#ga00f0ec4cac3b873b30ac5c4793f3c1d4">Cy_Crypto_Hmac_Run</a>(</div><div class="line">                        (uint32_t *)hmac256,</div><div class="line">                        (uint32_t *)hmac256PlainText,</div><div class="line">                        <span class="keyword">sizeof</span>(hmac256PlainText),</div><div class="line">                        (uint32_t *)hmac256Key,</div><div class="line">                        <span class="keyword">sizeof</span>(hmac256Key),</div><div class="line">                        <a class="code" href="group__group__crypto__enums.html#gga66ead9efce36e261e978cad722bf2dbba2212390919051b39d22d567c508c6d1f">CY_CRYPTO_MODE_SHA256</a>,</div><div class="line">                        &amp;cryptoShaContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Wait crypto become available */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a>(<a class="code" href="group__group__crypto__cli__srv__macros.html#ga7cad37b39669bf7ec2994103962c73ad">CY_CRYPTO_SYNC_BLOCKING</a>);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga50ce97ec1e079773c7ea32f4f94c7db3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga50ce97ec1e079773c7ea32f4f94c7db3">&#9670;&nbsp;</a></span>Cy_Crypto_Str_MemCpy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Str_MemCpy </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void const *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function copies a memory block. </p>
<p>It operates on data in the user SRAM and doesn't use Crypto internal SRAM.</p>
<dl class="section note"><dt>Note</dt><dd>Memory blocks should not overlap.</dd></dl>
<p>There is no alignment restriction. This function is independent of the previous Crypto state.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dst</td><td>The pointer to the destination of MemCpy.</td></tr>
    <tr><td class="paramname">src</td><td>The pointer to the source of MemCpy.</td></tr>
    <tr><td class="paramname">size</td><td>The size in bytes of the copy operation. Maximum size is 65535 Bytes.</td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> structure that stores all internal variables for the Crypto driver.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="ga5a6972d7cac1b2af39017c3b814100df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5a6972d7cac1b2af39017c3b814100df">&#9670;&nbsp;</a></span>Cy_Crypto_Str_MemSet()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Str_MemSet </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sets the memory block. </p>
<p>It operates on data in the user SRAM and doesn't use Crypto internal SRAM.</p>
<p>There is no alignment restriction. This function is independent from the previous Crypto state.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dst</td><td>The pointer to the destination of MemSet.</td></tr>
    <tr><td class="paramname">data</td><td>The value to be set.</td></tr>
    <tr><td class="paramname">size</td><td>The size in bytes of the set operation. Maximum size is 65535 Bytes.</td></tr>
    <tr><td class="paramname">cfContext</td><td>the pointer to the <a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> structure that stores all internal variables for the Crypto driver.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="ga1f6950833770e1f2b932f089fcd126b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1f6950833770e1f2b932f089fcd126b2">&#9670;&nbsp;</a></span>Cy_Crypto_Str_MemCmp()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Str_MemCmp </td>
          <td>(</td>
          <td class="paramtype">void const *&#160;</td>
          <td class="paramname"><em>src0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void const *&#160;</td>
          <td class="paramname"><em>src1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>resultPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function compares memory blocks. </p>
<p>It operates on data in the user SRAM and doesn't use Crypto internal SRAM.</p>
<p>There is no alignment restriction. This function is independent from the previous Crypto state.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src0</td><td>The pointer to the first source of MemCmp.(<b>must be 4-byte aligned</b>)</td></tr>
    <tr><td class="paramname">src1</td><td>The pointer to the second source of MemCmp.</td></tr>
    <tr><td class="paramname">size</td><td>The size in bytes of the compare operation. Maximum size is 65535 Bytes.</td></tr>
    <tr><td class="paramname">resultPtr</td><td>The pointer to the result of compare (<b>must be 4-byte aligned</b>):<ul>
<li>0 - if Source 1 equal Source 2</li>
<li>1 - if Source 1 not equal Source 2</li>
</ul>
</td></tr>
    <tr><td class="paramname">cfContext</td><td>the pointer to the <a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> structure that stores all internal variables for the Crypto driver. <b>must be 4-byte aligned</b></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="ga83173ba7fa2dd56777c23da6098f8372"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga83173ba7fa2dd56777c23da6098f8372">&#9670;&nbsp;</a></span>Cy_Crypto_Str_MemXor()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Str_MemXor </td>
          <td>(</td>
          <td class="paramtype">void const *&#160;</td>
          <td class="paramname"><em>src0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void const *&#160;</td>
          <td class="paramname"><em>src1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function calculates the XOR of two memory blocks. </p>
<p>It operates on data in the user SRAM and doesn't use Crypto internal SRAM.</p>
<dl class="section note"><dt>Note</dt><dd>Memory structures should not overlap.</dd></dl>
<p>There is no alignment restriction. This function is independent from the previous Crypto state.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src0</td><td>The pointer to the first source of MemXor.</td></tr>
    <tr><td class="paramname">src1</td><td>The pointer to the second source of MemXor.</td></tr>
    <tr><td class="paramname">dst</td><td>The pointer to the destination of MemXor.</td></tr>
    <tr><td class="paramname">size</td><td>The size in bytes of the compare operation. Maximum size is 65535 Bytes.</td></tr>
    <tr><td class="paramname">cfContext</td><td>the pointer to the <a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> structure that stores all internal variables for the Crypto driver.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="ga833ab5adcd2c03da11cc883eb706ff20"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga833ab5adcd2c03da11cc883eb706ff20">&#9670;&nbsp;</a></span>Cy_Crypto_Crc_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Crc_Init </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>polynomial</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>dataReverse</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>dataXor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>remReverse</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>remXor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__crc__t.html">cy_stc_crypto_context_crc_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function performs CRC initialization. </p>
<p>Call to initialize this encryption technique before using any associated functions. You must initialize this technique again after using any other encryption technique.</p>
<p>Below is the table with known polynomials with different parameters and their calculated CRCs from the string <b>"123456789"</b>: </p><table class="doxtable">
<tr>
<th align="left">Name </th><th align="center">Width </th><th align="center">Poly </th><th align="center">Init </th><th align="center">Data Rev </th><th align="center">Data XOR </th><th align="center">Rem Rev </th><th align="center">Rem XOR </th><th align="center">Expected CRC  </th></tr>
<tr>
<td align="left">CRC-3 / ROHC </td><td align="center">3 </td><td align="center">0x3 </td><td align="center">0x7 </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0 </td><td align="center">0x6 </td></tr>
<tr>
<td align="left">CRC-4 / ITU </td><td align="center">4 </td><td align="center">0x3 </td><td align="center">0x0 </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0 </td><td align="center">0x7 </td></tr>
<tr>
<td align="left">CRC-5 / EPC </td><td align="center">5 </td><td align="center">0x9 </td><td align="center">0x9 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0x0 </td></tr>
<tr>
<td align="left">CRC-5 / ITU </td><td align="center">5 </td><td align="center">0x15 </td><td align="center">0x0 </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0 </td><td align="center">0x7 </td></tr>
<tr>
<td align="left">CRC-5 / USB </td><td align="center">5 </td><td align="center">0x5 </td><td align="center">0x1F </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x1F </td><td align="center">0x19 </td></tr>
<tr>
<td align="left">CRC-6 / CDMA2000-A </td><td align="center">6 </td><td align="center">0x27 </td><td align="center">0x3F </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0xD </td></tr>
<tr>
<td align="left">CRC-6 / CDMA2000-B </td><td align="center">6 </td><td align="center">0x7 </td><td align="center">0x3F </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0x3B </td></tr>
<tr>
<td align="left">CRC-6 / DARC </td><td align="center">6 </td><td align="center">0x19 </td><td align="center">0x0 </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0 </td><td align="center">0x26 </td></tr>
<tr>
<td align="left">CRC-6 / ITU </td><td align="center">6 </td><td align="center">0x3 </td><td align="center">0x0 </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0 </td><td align="center">0x6 </td></tr>
<tr>
<td align="left">CRC-7 </td><td align="center">7 </td><td align="center">0x9 </td><td align="center">0x0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0x75 </td></tr>
<tr>
<td align="left">CRC-7 / ROHC </td><td align="center">7 </td><td align="center">0x4F </td><td align="center">0x7F </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0 </td><td align="center">0x53 </td></tr>
<tr>
<td align="left">CRC-8 </td><td align="center">8 </td><td align="center">0x7 </td><td align="center">0x0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0xF4 </td></tr>
<tr>
<td align="left">CRC-8 / CDMA2000 </td><td align="center">8 </td><td align="center">0x9B </td><td align="center">0xFF </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0xDA </td></tr>
<tr>
<td align="left">CRC-8 / DARC </td><td align="center">8 </td><td align="center">0x39 </td><td align="center">0x0 </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0 </td><td align="center">0x15 </td></tr>
<tr>
<td align="left">CRC-8 / DVB-S2 </td><td align="center">8 </td><td align="center">0xD5 </td><td align="center">0x0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0xBC </td></tr>
<tr>
<td align="left">CRC-8 / EBU </td><td align="center">8 </td><td align="center">0x1D </td><td align="center">0xFF </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0 </td><td align="center">0x97 </td></tr>
<tr>
<td align="left">CRC-8 / I-CODE </td><td align="center">8 </td><td align="center">0x1D </td><td align="center">0xFD </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0x7E </td></tr>
<tr>
<td align="left">CRC-8 / ITU </td><td align="center">8 </td><td align="center">0x7 </td><td align="center">0x0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x55 </td><td align="center">0xA1 </td></tr>
<tr>
<td align="left">CRC-8 / MAXIM </td><td align="center">8 </td><td align="center">0x31 </td><td align="center">0x0 </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0 </td><td align="center">0xA1 </td></tr>
<tr>
<td align="left">CRC-8 / ROHC </td><td align="center">8 </td><td align="center">0x7 </td><td align="center">0xFF </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0 </td><td align="center">0xD0 </td></tr>
<tr>
<td align="left">CRC-8 / WCDMA </td><td align="center">8 </td><td align="center">0x9B </td><td align="center">0x0 </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0 </td><td align="center">0x25 </td></tr>
<tr>
<td align="left">CRC-10 </td><td align="center">10 </td><td align="center">0x233 </td><td align="center">0x0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0x199 </td></tr>
<tr>
<td align="left">CRC-10 / CDMA2000 </td><td align="center">10 </td><td align="center">0x3D9 </td><td align="center">0x3FF </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0x233 </td></tr>
<tr>
<td align="left">CRC-11 </td><td align="center">11 </td><td align="center">0x385 </td><td align="center">0x1A </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0x5A3 </td></tr>
<tr>
<td align="left">CRC-12 / 3GPP </td><td align="center">12 </td><td align="center">0x80F </td><td align="center">0x0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0 </td><td align="center">0xDAF </td></tr>
<tr>
<td align="left">CRC-12 / CDMA2000 </td><td align="center">12 </td><td align="center">0xF13 </td><td align="center">0xFFF </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0xD4D </td></tr>
<tr>
<td align="left">CRC-12 / DECT </td><td align="center">12 </td><td align="center">0x80F </td><td align="center">0x0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0xF5B </td></tr>
<tr>
<td align="left">CRC-13 / BBC </td><td align="center">13 </td><td align="center">0x1CF5 </td><td align="center">0x0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0x4FA </td></tr>
<tr>
<td align="left">CRC-14 / DARC </td><td align="center">14 </td><td align="center">0x805 </td><td align="center">0x0 </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0 </td><td align="center">0x82D </td></tr>
<tr>
<td align="left">CRC-15 </td><td align="center">15 </td><td align="center">0x4599 </td><td align="center">0x0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0x59E </td></tr>
<tr>
<td align="left">CRC-15 / MPT1327 </td><td align="center">15 </td><td align="center">0x6815 </td><td align="center">0x0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x1 </td><td align="center">0x2566 </td></tr>
<tr>
<td align="left">CRC-24 </td><td align="center">24 </td><td align="center">0x0864CFB </td><td align="center">0x00B704CE </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0x21CF02 </td></tr>
<tr>
<td align="left">CRC-24 / FLEXRAY-A </td><td align="center">24 </td><td align="center">0x05D6DCB </td><td align="center">0x00FEDCBA </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0x7979BD </td></tr>
<tr>
<td align="left">CRC-24 / FLEXRAY-B </td><td align="center">24 </td><td align="center">0x05D6DCB </td><td align="center">0x00ABCDEF </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0 </td><td align="center">0x1F23B8 </td></tr>
<tr>
<td align="left">CRC-31 / PHILIPS </td><td align="center">31 </td><td align="center">0x4C11DB7 </td><td align="center">0x7FFFFFFF </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x7FFFFFFF </td><td align="center">0xCE9E46C </td></tr>
<tr>
<td align="left">CRC-16 / ARC </td><td align="center">16 </td><td align="center">0x8005 </td><td align="center">0x0000 </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0000 </td><td align="center">0xBB3D </td></tr>
<tr>
<td align="left">CRC-16 / AUG-CCITT </td><td align="center">16 </td><td align="center">0x1021 </td><td align="center">0x1D0F </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0000 </td><td align="center">0xE5CC </td></tr>
<tr>
<td align="left">CRC-16 / BUYPASS </td><td align="center">16 </td><td align="center">0x8005 </td><td align="center">0x0000 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0000 </td><td align="center">0xFEE8 </td></tr>
<tr>
<td align="left">CRC-16 / CCITT-0 </td><td align="center">16 </td><td align="center">0x1021 </td><td align="center">0xFFFF </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0000 </td><td align="center">0x29B1 </td></tr>
<tr>
<td align="left">CRC-16 / CDMA2000 </td><td align="center">16 </td><td align="center">0xC867 </td><td align="center">0xFFFF </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0000 </td><td align="center">0x4C06 </td></tr>
<tr>
<td align="left">CRC-16 / DDS-110 </td><td align="center">16 </td><td align="center">0x8005 </td><td align="center">0x800D </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0000 </td><td align="center">0x9ECF </td></tr>
<tr>
<td align="left">CRC-16 / DECT-R </td><td align="center">16 </td><td align="center">0x0589 </td><td align="center">0x0000 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0001 </td><td align="center">0x007E </td></tr>
<tr>
<td align="left">CRC-16 / DECT-X </td><td align="center">16 </td><td align="center">0x0589 </td><td align="center">0x0000 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0000 </td><td align="center">0x007F </td></tr>
<tr>
<td align="left">CRC-16 / DNP </td><td align="center">16 </td><td align="center">0x3D65 </td><td align="center">0x0000 </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0xFFFF </td><td align="center">0xEA82 </td></tr>
<tr>
<td align="left">CRC-16 / EN-13757 </td><td align="center">16 </td><td align="center">0x3D65 </td><td align="center">0x0000 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0xFFFF </td><td align="center">0xC2B7 </td></tr>
<tr>
<td align="left">CRC-16 / GENIBUS </td><td align="center">16 </td><td align="center">0x1021 </td><td align="center">0xFFFF </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0xFFFF </td><td align="center">0xD64E </td></tr>
<tr>
<td align="left">CRC-16 / MAXIM </td><td align="center">16 </td><td align="center">0x8005 </td><td align="center">0x0000 </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0xFFFF </td><td align="center">0x44C2 </td></tr>
<tr>
<td align="left">CRC-16 / MCRF4XX </td><td align="center">16 </td><td align="center">0x1021 </td><td align="center">0xFFFF </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0000 </td><td align="center">0x6F91 </td></tr>
<tr>
<td align="left">CRC-16 / RIELLO </td><td align="center">16 </td><td align="center">0x1021 </td><td align="center">0xB2AA </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0000 </td><td align="center">0x63D0 </td></tr>
<tr>
<td align="left">CRC-16 / T10-DIF </td><td align="center">16 </td><td align="center">0x8BB7 </td><td align="center">0x0000 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0000 </td><td align="center">0xD0DB </td></tr>
<tr>
<td align="left">CRC-16 / TELEDISK </td><td align="center">16 </td><td align="center">0xA097 </td><td align="center">0x0000 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0000 </td><td align="center">0x0FB3 </td></tr>
<tr>
<td align="left">CRC-16 / TMS37157 </td><td align="center">16 </td><td align="center">0x1021 </td><td align="center">0x89EC </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0000 </td><td align="center">0x26B1 </td></tr>
<tr>
<td align="left">CRC-16 / USB </td><td align="center">16 </td><td align="center">0x8005 </td><td align="center">0xFFFF </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0xFFFF </td><td align="center">0xB4C8 </td></tr>
<tr>
<td align="left">CRC-A </td><td align="center">16 </td><td align="center">0x1021 </td><td align="center">0xC6C6 </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0000 </td><td align="center">0xBF05 </td></tr>
<tr>
<td align="left">CRC-16 / KERMIT </td><td align="center">16 </td><td align="center">0x1021 </td><td align="center">0x0000 </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0000 </td><td align="center">0x2189 </td></tr>
<tr>
<td align="left">CRC-16 / MODBUS </td><td align="center">16 </td><td align="center">0x8005 </td><td align="center">0xFFFF </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x0000 </td><td align="center">0x4B37 </td></tr>
<tr>
<td align="left">CRC-16 / X-25 </td><td align="center">16 </td><td align="center">0x1021 </td><td align="center">0xFFFF </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0xFFFF </td><td align="center">0x906E </td></tr>
<tr>
<td align="left">CRC-16 / XMODEM </td><td align="center">16 </td><td align="center">0x1021 </td><td align="center">0x0000 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x0000 </td><td align="center">0x31C3 </td></tr>
<tr>
<td align="left">CRC-32 </td><td align="center">32 </td><td align="center">0x04C11DB7 </td><td align="center">0xFFFFFFFF </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0xFFFFFFFF </td><td align="center">0xCBF43926 </td></tr>
<tr>
<td align="left">CRC-32 / BZIP2 </td><td align="center">32 </td><td align="center">0x04C11DB7 </td><td align="center">0xFFFFFFFF </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0xFFFFFFFF </td><td align="center">0xFC891918 </td></tr>
<tr>
<td align="left">CRC-32C </td><td align="center">32 </td><td align="center">0x1EDC6F41 </td><td align="center">0xFFFFFFFF </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0xFFFFFFFF </td><td align="center">0xE3069283 </td></tr>
<tr>
<td align="left">CRC-32D </td><td align="center">32 </td><td align="center">0xA833982B </td><td align="center">0xFFFFFFFF </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0xFFFFFFFF </td><td align="center">0x87315576 </td></tr>
<tr>
<td align="left">CRC-32 / MPEG-2 </td><td align="center">32 </td><td align="center">0x04C11DB7 </td><td align="center">0xFFFFFFFF </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x00000000 </td><td align="center">0x0376E6E7 </td></tr>
<tr>
<td align="left">CRC-32 / POSIX </td><td align="center">32 </td><td align="center">0x04C11DB7 </td><td align="center">0x00000000 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0xFFFFFFFF </td><td align="center">0x765E7680 </td></tr>
<tr>
<td align="left">CRC-32Q </td><td align="center">32 </td><td align="center">0x814141AB </td><td align="center">0x00000000 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x00000000 </td><td align="center">0x3010BF7F </td></tr>
<tr>
<td align="left">CRC-32 / JAMCRC </td><td align="center">32 </td><td align="center">0x04C11DB7 </td><td align="center">0xFFFFFFFF </td><td align="center">1 </td><td align="center">0 </td><td align="center">1 </td><td align="center">0x00000000 </td><td align="center">0x340BC6D9 </td></tr>
<tr>
<td align="left">CRC-32 / XFER </td><td align="center">32 </td><td align="center">0x000000AF </td><td align="center">0x00000000 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0 </td><td align="center">0x00000000 </td><td align="center">0xBD0BE338 </td></tr>
</table>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">polynomial</td><td>The polynomial (specified using 32 bits) used in the computing CRC.</td></tr>
    <tr><td class="paramname">dataReverse</td><td>The order in which data bytes are processed. 0 - MSB first; 1- LSB first.</td></tr>
    <tr><td class="paramname">dataXor</td><td>The byte mask for XORing data</td></tr>
    <tr><td class="paramname">remReverse</td><td>A remainder reverse: 0 means the remainder is not reversed. 1 means reversed.</td></tr>
    <tr><td class="paramname">remXor</td><td>Specifies a mask with which the LFSR32 register is XORed to produce a remainder.</td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__crc__t.html">cy_stc_crypto_context_crc_t</a> structure that stores the Crypto driver context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section note"><dt>Note</dt><dd>The polynomial, initial seed and remainder XOR values are <b>always</b> provided as MSB aligned (so actual higher bit should be located in 31s bit of the parameter value).<br />
 Calculated CRC value is MSB aligned <b>only when dataReverse is zero</b>.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* CRC parameters for some CRC algorithms:</span></div><div class="line"><span class="comment">    +---------------------+-----+------------+------------+------+------+-----+------------+------------+</span></div><div class="line"><span class="comment">    | CRC algorithm Name  | CRC |  Polynom   |   Initial  | Data | Data | Rem |  Remainder |  Expected  |</span></div><div class="line"><span class="comment">    |                     | len |            |    seed    | REV  | XOR  | REV |    XOR     |    CRC     |</span></div><div class="line"><span class="comment">    | ------------------- | --- | ---------- |----------- | ---- | ---- | --- | ---------- | ---------- |</span></div><div class="line"><span class="comment">    | CRC-6  / CDMA2000-A |  6  |    0x27    |    0x3F    |   0  |   0  |  0  |    0x00    |    0x0D    |</span></div><div class="line"><span class="comment">    | CRC-6  / CDMA2000-B |  6  |    0x07    |    0x3F    |   0  |   0  |  0  |    0x00    |    0x3B    |</span></div><div class="line"><span class="comment">    | CRC-6  / DARC       |  6  |    0x19    |    0x00    |   1  |   0  |  1  |    0x00    |    0x26    |</span></div><div class="line"><span class="comment">    | CRC-6  / ITU        |  6  |    0x03    |    0x00    |   1  |   0  |  1  |    0x00    |    0x06    |</span></div><div class="line"><span class="comment">    | CRC-8  / ITU        |  8  |    0x07    |    0x00    |   0  |   0  |  0  |    0x55    |    0xA1    |</span></div><div class="line"><span class="comment">    | CRC-8  / MAXIM      |  8  |    0x31    |    0x00    |   1  |   0  |  1  |    0x00    |    0xA1    |</span></div><div class="line"><span class="comment">    | CRC-8  / ROHC       |  8  |    0x07    |    0xFF    |   1  |   0  |  1  |    0x00    |    0xD0    |</span></div><div class="line"><span class="comment">    | CRC-8  / WCDMA      |  8  |    0x9B    |    0x00    |   1  |   0  |  1  |    0x00    |    0x25    |</span></div><div class="line"><span class="comment">    | CRC-16 / CCITT-0    | 16  |   0x1021   |   0xFFFF   |   0  |   0  |  0  |   0x0000   |   0x29B1   |</span></div><div class="line"><span class="comment">    | CRC-16 / CDMA2000   | 16  |   0xC867   |   0xFFFF   |   0  |   0  |  0  |   0x0000   |   0x4C06   |</span></div><div class="line"><span class="comment">    | CRC-32              | 32  | 0x04C11DB7 | 0xFFFFFFFF |   1  |   0  |  1  | 0xFFFFFFFF | 0xCBF43926 |</span></div><div class="line"><span class="comment">    | CRC-32 / BZIP2      | 32  | 0x04C11DB7 | 0xFFFFFFFF |   0  |   0  |  0  | 0xFFFFFFFF | 0xFC891918 |</span></div><div class="line"><span class="comment">    +---------------------+-----+------------+------------+------+------+-----+------------+------------+</span></div><div class="line"><span class="comment">    */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Use &quot;CRC-16/CCITT-0&quot; calculation */</span></div><div class="line"><span class="preprocessor">    #define CRC_BITLEN          (16u)</span></div><div class="line"><span class="preprocessor">    #define CRC_POLYNOMIAL      (0x1021u)</span></div><div class="line"><span class="preprocessor">    #define CRC_LFSR_SEED       (0xffffu)</span></div><div class="line"><span class="preprocessor">    #define CRC_DATA_REVERSE    (0u)</span></div><div class="line"><span class="preprocessor">    #define CRC_DATA_XOR        (0u)</span></div><div class="line"><span class="preprocessor">    #define CRC_REM_REVERSE     (0u)</span></div><div class="line"><span class="preprocessor">    #define CRC_REM_XOR         (0x0000u)</span></div><div class="line"></div><div class="line">    CY_ALIGN(4) uint8_t         message[9] = &quot;123456789&quot;;</div><div class="line">    CY_ALIGN(4) uint32_t        calculatedCrc = 0;</div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__crypto__context__crc__t.html">cy_stc_crypto_context_crc_t</a> cryptoCrcContext;</div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>       cryptoStatus;</div><div class="line"></div><div class="line">    <span class="comment">/* Initialization Crypto operation */</span></div><div class="line">    <span class="comment">/* Note: Polynomial and Remainder XOR values are always MSB aligned. */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#ga833ab5adcd2c03da11cc883eb706ff20">Cy_Crypto_Crc_Init</a>((CRC_POLYNOMIAL &lt;&lt; (32 - CRC_BITLEN)),</div><div class="line">                                CRC_DATA_REVERSE,</div><div class="line">                                CRC_DATA_XOR,</div><div class="line">                                CRC_REM_REVERSE,</div><div class="line">                                (CRC_REM_XOR &lt;&lt; (32 - CRC_BITLEN)),</div><div class="line">                                &amp;cryptoCrcContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Wait crypto become available */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a>(<a class="code" href="group__group__crypto__cli__srv__macros.html#ga7cad37b39669bf7ec2994103962c73ad">CY_CRYPTO_SYNC_BLOCKING</a>);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Calculate CRC */</span></div><div class="line">    <span class="comment">/* Note: Initial seed value is always MSB aligned. */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#ga3c78c11d34fa63664275a7df5b35062c">Cy_Crypto_Crc_Run</a>((<span class="keywordtype">void</span>*)message,</div><div class="line">                                sizeof(message),</div><div class="line">                                &amp;calculatedCrc,</div><div class="line">                                (uint32_t)(CRC_LFSR_SEED &lt;&lt; (32u - CRC_BITLEN)),</div><div class="line">                                &amp;cryptoCrcContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Wait crypto become available */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a>(CY_CRYPTO_SYNC_BLOCKING);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Note: Calculated CRC value is MSB aligned and should be shifted WHEN CRC_DATA_REVERSE is zero. */</span></div><div class="line">    if (CRC_DATA_REVERSE == 0u)</div><div class="line">    {</div><div class="line">        calculatedCrc = calculatedCrc &gt;&gt; (32 - CRC_BITLEN);</div><div class="line">    }</div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga3c78c11d34fa63664275a7df5b35062c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3c78c11d34fa63664275a7df5b35062c">&#9670;&nbsp;</a></span>Cy_Crypto_Crc_Run()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Crc_Run </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>dataSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>crc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>lfsrInitState</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__crc__t.html">cy_stc_crypto_context_crc_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function performs CRC calculation on a message. </p>
<p>It depends on <a class="el" href="group__group__crypto__cli__functions.html#ga833ab5adcd2c03da11cc883eb706ff20">Cy_Crypto_Crc_Init()</a>, which should be called before.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>The pointer to the message whose CRC is being computed.</td></tr>
    <tr><td class="paramname">dataSize</td><td>The size of a message in bytes.</td></tr>
    <tr><td class="paramname">crc</td><td>The pointer to a computed CRC value. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">lfsrInitState</td><td>The initial state of the LFSR.</td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__crc__t.html">cy_stc_crypto_context_crc_t</a> structure that stores the Crypto driver context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section note"><dt>Note</dt><dd>The polynomial, initial seed and remainder XOR values are <b>always</b> provided as MSB aligned (so actual higher bit should be located in 31s bit of the parameter value).<br />
 Calculated CRC value is MSB aligned <b>only when dataReverse is zero</b>.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* CRC parameters for some CRC algorithms:</span></div><div class="line"><span class="comment">    +---------------------+-----+------------+------------+------+------+-----+------------+------------+</span></div><div class="line"><span class="comment">    | CRC algorithm Name  | CRC |  Polynom   |   Initial  | Data | Data | Rem |  Remainder |  Expected  |</span></div><div class="line"><span class="comment">    |                     | len |            |    seed    | REV  | XOR  | REV |    XOR     |    CRC     |</span></div><div class="line"><span class="comment">    | ------------------- | --- | ---------- |----------- | ---- | ---- | --- | ---------- | ---------- |</span></div><div class="line"><span class="comment">    | CRC-6  / CDMA2000-A |  6  |    0x27    |    0x3F    |   0  |   0  |  0  |    0x00    |    0x0D    |</span></div><div class="line"><span class="comment">    | CRC-6  / CDMA2000-B |  6  |    0x07    |    0x3F    |   0  |   0  |  0  |    0x00    |    0x3B    |</span></div><div class="line"><span class="comment">    | CRC-6  / DARC       |  6  |    0x19    |    0x00    |   1  |   0  |  1  |    0x00    |    0x26    |</span></div><div class="line"><span class="comment">    | CRC-6  / ITU        |  6  |    0x03    |    0x00    |   1  |   0  |  1  |    0x00    |    0x06    |</span></div><div class="line"><span class="comment">    | CRC-8  / ITU        |  8  |    0x07    |    0x00    |   0  |   0  |  0  |    0x55    |    0xA1    |</span></div><div class="line"><span class="comment">    | CRC-8  / MAXIM      |  8  |    0x31    |    0x00    |   1  |   0  |  1  |    0x00    |    0xA1    |</span></div><div class="line"><span class="comment">    | CRC-8  / ROHC       |  8  |    0x07    |    0xFF    |   1  |   0  |  1  |    0x00    |    0xD0    |</span></div><div class="line"><span class="comment">    | CRC-8  / WCDMA      |  8  |    0x9B    |    0x00    |   1  |   0  |  1  |    0x00    |    0x25    |</span></div><div class="line"><span class="comment">    | CRC-16 / CCITT-0    | 16  |   0x1021   |   0xFFFF   |   0  |   0  |  0  |   0x0000   |   0x29B1   |</span></div><div class="line"><span class="comment">    | CRC-16 / CDMA2000   | 16  |   0xC867   |   0xFFFF   |   0  |   0  |  0  |   0x0000   |   0x4C06   |</span></div><div class="line"><span class="comment">    | CRC-32              | 32  | 0x04C11DB7 | 0xFFFFFFFF |   1  |   0  |  1  | 0xFFFFFFFF | 0xCBF43926 |</span></div><div class="line"><span class="comment">    | CRC-32 / BZIP2      | 32  | 0x04C11DB7 | 0xFFFFFFFF |   0  |   0  |  0  | 0xFFFFFFFF | 0xFC891918 |</span></div><div class="line"><span class="comment">    +---------------------+-----+------------+------------+------+------+-----+------------+------------+</span></div><div class="line"><span class="comment">    */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Use &quot;CRC-16/CCITT-0&quot; calculation */</span></div><div class="line"><span class="preprocessor">    #define CRC_BITLEN          (16u)</span></div><div class="line"><span class="preprocessor">    #define CRC_POLYNOMIAL      (0x1021u)</span></div><div class="line"><span class="preprocessor">    #define CRC_LFSR_SEED       (0xffffu)</span></div><div class="line"><span class="preprocessor">    #define CRC_DATA_REVERSE    (0u)</span></div><div class="line"><span class="preprocessor">    #define CRC_DATA_XOR        (0u)</span></div><div class="line"><span class="preprocessor">    #define CRC_REM_REVERSE     (0u)</span></div><div class="line"><span class="preprocessor">    #define CRC_REM_XOR         (0x0000u)</span></div><div class="line"></div><div class="line">    CY_ALIGN(4) uint8_t         message[9] = &quot;123456789&quot;;</div><div class="line">    CY_ALIGN(4) uint32_t        calculatedCrc = 0;</div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__crypto__context__crc__t.html">cy_stc_crypto_context_crc_t</a> cryptoCrcContext;</div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>       cryptoStatus;</div><div class="line"></div><div class="line">    <span class="comment">/* Initialization Crypto operation */</span></div><div class="line">    <span class="comment">/* Note: Polynomial and Remainder XOR values are always MSB aligned. */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#ga833ab5adcd2c03da11cc883eb706ff20">Cy_Crypto_Crc_Init</a>((CRC_POLYNOMIAL &lt;&lt; (32 - CRC_BITLEN)),</div><div class="line">                                CRC_DATA_REVERSE,</div><div class="line">                                CRC_DATA_XOR,</div><div class="line">                                CRC_REM_REVERSE,</div><div class="line">                                (CRC_REM_XOR &lt;&lt; (32 - CRC_BITLEN)),</div><div class="line">                                &amp;cryptoCrcContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Wait crypto become available */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a>(<a class="code" href="group__group__crypto__cli__srv__macros.html#ga7cad37b39669bf7ec2994103962c73ad">CY_CRYPTO_SYNC_BLOCKING</a>);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Calculate CRC */</span></div><div class="line">    <span class="comment">/* Note: Initial seed value is always MSB aligned. */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#ga3c78c11d34fa63664275a7df5b35062c">Cy_Crypto_Crc_Run</a>((<span class="keywordtype">void</span>*)message,</div><div class="line">                                sizeof(message),</div><div class="line">                                &amp;calculatedCrc,</div><div class="line">                                (uint32_t)(CRC_LFSR_SEED &lt;&lt; (32u - CRC_BITLEN)),</div><div class="line">                                &amp;cryptoCrcContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Wait crypto become available */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a>(CY_CRYPTO_SYNC_BLOCKING);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Note: Calculated CRC value is MSB aligned and should be shifted WHEN CRC_DATA_REVERSE is zero. */</span></div><div class="line">    if (CRC_DATA_REVERSE == 0u)</div><div class="line">    {</div><div class="line">        calculatedCrc = calculatedCrc &gt;&gt; (32 - CRC_BITLEN);</div><div class="line">    }</div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga69061dfb8a8ccd707edf8151e1427987"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga69061dfb8a8ccd707edf8151e1427987">&#9670;&nbsp;</a></span>Cy_Crypto_Trng_Generate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Trng_Generate </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>GAROPol</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>FIROPol</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>randomNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__trng__t.html">cy_stc_crypto_context_trng_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function generates a 32-bit True Random Number. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">GAROPol</td><td>The polynomial for the programmable Galois ring oscillator.</td></tr>
    <tr><td class="paramname">FIROPol</td><td>The polynomial for the programmable Fibonacci ring oscillator.</td></tr>
    <tr><td class="paramname">max</td><td>The maximum length of a random number, in the range [0, 32] bits.</td></tr>
    <tr><td class="paramname">randomNum</td><td>The pointer to a generated true random number. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__trng__t.html">cy_stc_crypto_context_trng_t</a> structure that stores the Crypto driver context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* Initialization polynomial values for True Random Generator.</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">        Polynomial for programmable Galois ring oscillator.</span></div><div class="line"><span class="comment">        The polynomial is represented WITHOUT the high order bit (this bit is always assumed &#39;1&#39;).</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">        GARO 31 bit polynomial (0x04c1:1db7) = x31 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">        Polynomial for programmable Fibonacci ring oscillator.</span></div><div class="line"><span class="comment">        The polynomial is represented WITHOUT the high order bit (this bit is always assumed &#39;1&#39;).</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">        FIRO 31 bit polynomial (0x04c1:1db7) = x31 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1</span></div><div class="line"><span class="comment">    */</span></div><div class="line"><span class="preprocessor">    #define GARO31_INITSTATE      (0x04c11db7)</span></div><div class="line"><span class="preprocessor">    #define FIRO31_INITSTATE      (0x04c11db7)</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define MAX_TRNG_BIT_SIZE     (32UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Generated Random Number */</span></div><div class="line">    uint32_t rndNum = 0;</div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__crypto__context__trng__t.html">cy_stc_crypto_context_trng_t</a>  cryptoTrngContext;</div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>         cryptoStatus;</div><div class="line"></div><div class="line">    <span class="comment">/* Generate True Random number */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#ga69061dfb8a8ccd707edf8151e1427987">Cy_Crypto_Trng_Generate</a>(</div><div class="line">                        GARO31_INITSTATE,</div><div class="line">                        FIRO31_INITSTATE,</div><div class="line">                        MAX_TRNG_BIT_SIZE,</div><div class="line">                        &amp;rndNum, &amp;cryptoTrngContext);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Wait crypto become available */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a>(<a class="code" href="group__group__crypto__cli__srv__macros.html#ga7cad37b39669bf7ec2994103962c73ad">CY_CRYPTO_SYNC_BLOCKING</a>);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gab5ab6f272d15ebb2fb14000530b6d29a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab5ab6f272d15ebb2fb14000530b6d29a">&#9670;&nbsp;</a></span>Cy_Crypto_Des_Run()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Des_Run </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a>&#160;</td>
          <td class="paramname"><em>dirMode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>dstBlock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>srcBlock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__des__t.html">cy_stc_crypto_context_des_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function performs DES operation on a Single Block. </p>
<p>All addresses must be 4-Byte aligned. Ciphertext (dstBlock) may overlap with plaintext (srcBlock) There is no Init function. Provide the required parameters and the pointer to the context structure when making this function call.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dirMode</td><td>Can be <a class="el" href="group__group__crypto__enums.html#ggae040fb530d4d110976bedfcdb7c8f09ca4b95ef1e3f73771b0c6a376c6d43e16d">CY_CRYPTO_ENCRYPT</a> or <a class="el" href="group__group__crypto__enums.html#ggae040fb530d4d110976bedfcdb7c8f09cac7ccc0aa22f73054744e87593deb77fd">CY_CRYPTO_DECRYPT</a> (<a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a>)</td></tr>
    <tr><td class="paramname">key</td><td>The pointer to the encryption/decryption key. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">srcBlock</td><td>The pointer to a source block. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">dstBlock</td><td>The pointer to a destination cipher block. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__des__t.html" title="The structure for storing the DES context. ">cy_stc_crypto_context_des_t</a> structure that stores the Crypto driver context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="ga86c02f38711df37a1ca8f9b505ad5f2c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga86c02f38711df37a1ca8f9b505ad5f2c">&#9670;&nbsp;</a></span>Cy_Crypto_Tdes_Run()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Tdes_Run </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a>&#160;</td>
          <td class="paramname"><em>dirMode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>dstBlock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>srcBlock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__des__t.html">cy_stc_crypto_context_des_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function performs the TDES operation on a single block. </p>
<p>All addresses <b>Must be 4-byte aligned.</b> Ciphertext (dstBlock) may overlap with plaintext (srcBlock). There is no Init function. Provide the required parameters and the pointer to the context structure when making this function call.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dirMode</td><td>Can be <a class="el" href="group__group__crypto__enums.html#ggae040fb530d4d110976bedfcdb7c8f09ca4b95ef1e3f73771b0c6a376c6d43e16d">CY_CRYPTO_ENCRYPT</a> or <a class="el" href="group__group__crypto__enums.html#ggae040fb530d4d110976bedfcdb7c8f09cac7ccc0aa22f73054744e87593deb77fd">CY_CRYPTO_DECRYPT</a> (<a class="el" href="group__group__crypto__enums.html#gae040fb530d4d110976bedfcdb7c8f09c">cy_en_crypto_dir_mode_t</a>)</td></tr>
    <tr><td class="paramname">key</td><td>The pointer to the encryption/decryption key. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">srcBlock</td><td>The pointer to a source block. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">dstBlock</td><td>The pointer to a destination cipher block. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__des__t.html" title="The structure for storing the DES context. ">cy_stc_crypto_context_des_t</a> structure that stores the Crypto driver context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Note: all keys are placed into the one keys array. */</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define STRING_LENGTH  8</span></div><div class="line">    CY_ALIGN(4) uint8_t msgString[STRING_LENGTH] = &quot;Crypto!&quot;;</div><div class="line">    CY_ALIGN(4) uint8_t encString[STRING_LENGTH];</div><div class="line"></div><div class="line">    <span class="preprocessor">#define KEY1 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77</span></div><div class="line"><span class="preprocessor">    #define KEY2 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF</span></div><div class="line"><span class="preprocessor">    #define KEY3 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08</span></div><div class="line"></div><div class="line">    CY_ALIGN(4) uint8_t tdesKey[] = { KEY1, KEY2, KEY3 };</div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__crypto__context__des__t.html">cy_stc_crypto_context_des_t</a> cryptoDesContext;</div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>       cryptoStatus;</div><div class="line"></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#ga86c02f38711df37a1ca8f9b505ad5f2c">Cy_Crypto_Tdes_Run</a> ( <a class="code" href="group__group__crypto__enums.html#ggae040fb530d4d110976bedfcdb7c8f09ca4b95ef1e3f73771b0c6a376c6d43e16d">CY_CRYPTO_ENCRYPT</a>,</div><div class="line">                                      (uint32_t *)tdesKey,    <span class="comment">/* Pointer to keys */</span></div><div class="line">                                      (uint32_t *)encString,  <span class="comment">/* Destination string */</span></div><div class="line">                                      (uint32_t *)msgString,  <span class="comment">/* Source String */</span></div><div class="line">                                      &amp;cryptoDesContext );</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Wait crypto become available */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__cli__functions.html#gac3fb202ea63ed0bec857424f8aac4b7e">Cy_Crypto_Sync</a>(<a class="code" href="group__group__crypto__cli__srv__macros.html#ga7cad37b39669bf7ec2994103962c73ad">CY_CRYPTO_SYNC_BLOCKING</a>);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga7af64261d94fecab72944509ccafd3c1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7af64261d94fecab72944509ccafd3c1">&#9670;&nbsp;</a></span>Cy_Crypto_GetMemBufAddress()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_GetMemBufAddress </td>
          <td>(</td>
          <td class="paramtype">uint32_t **&#160;</td>
          <td class="paramname"><em>membufAddress</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function gets an operation memory buffer location. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">membufAddress</td><td>The pointer of the operation memory buffer.</td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> structure that stores the data context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="gaa3a3ecfb202af1b604b1fdf51e75aa55"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa3a3ecfb202af1b604b1fdf51e75aa55">&#9670;&nbsp;</a></span>Cy_Crypto_GetMemBufSize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_GetMemBufSize </td>
          <td>(</td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>membufSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function gets an operation memory buffer size. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">membufSize</td><td>The size of the memory buffer (in bytes)</td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> structure that stores the data context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="gaaa1e1ff151ed92f21f876bb404be1b8f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaa1e1ff151ed92f21f876bb404be1b8f">&#9670;&nbsp;</a></span>Cy_Crypto_SetMemBufAddress()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_SetMemBufAddress </td>
          <td>(</td>
          <td class="paramtype">uint32_t const *&#160;</td>
          <td class="paramname"><em>newMembufAddress</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>newMembufSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sets a new operation memory buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">newMembufAddress</td><td>The pointer to the new operation memory buffer. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">newMembufSize</td><td>The size of the new memory buffer (in bytes)</td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__str__t.html">cy_stc_crypto_context_str_t</a> structure that stores the data context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section note"><dt>Note</dt><dd>This function sets the default device specific values when vuMemoryAddr parameter is NULL and vuMemorySize parameter is zero.</dd>
<dd>
New memory buffer should be allocated in a memory region that is not protected by a protection scheme for use by Crypto hardware. </dd></dl>

</div>
</div>
<a id="gac73a47f8656e1056686f461c68956fed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac73a47f8656e1056686f461c68956fed">&#9670;&nbsp;</a></span>Cy_Crypto_Rsa_Proc()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Rsa_Proc </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__rsa__pub__key__t.html">cy_stc_crypto_rsa_pub_key_t</a> const *&#160;</td>
          <td class="paramname"><em>pubKey</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t const *&#160;</td>
          <td class="paramname"><em>message</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>messageSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>processedMessage</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__rsa__t.html">cy_stc_crypto_context_rsa_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function calculates (m^e mod modulo) where m is Message (Signature), e - public exponent using a public key in the next representation, it contains: modulo, public exponent, coefficient for Barrett reduction, binary inverse of the modulo, and result of (2^moduloLength mod modulo). </p>
<p>Not all fields in a key must be given. Modulo and public exponents are mandatory; Barrett coefficient, inverse modulo, and r-bar are optional. If they don't exist, their according pointers should be NULL. These coefficients could be calculated by <a class="el" href="group__group__crypto__cli__functions.html#gaf7d03e6a13f42bae1fbbcf6c05730129">Cy_Crypto_Rsa_CalcCoefs</a>. Their presence accelerates performance by five times. Approximate performance for 1024-bit modulo is 41.6 ms; for 2048-bit modulo is 142 ms when using a 25 MHz clock for Crypto HW. These numbers just for reference. They depend on many factors (compiler, optimization level, etc.).</p>
<p>Returns the processed value and a success value.</p>
<dl class="section note"><dt>Note</dt><dd><b>Incoming message</b> and <b>result processed message</b> must be in little-endian order.<br />
 The <b>modulus</b> and <b>exponent</b> values in the <a class="el" href="structcy__stc__crypto__rsa__pub__key__t.html">cy_stc_crypto_rsa_pub_key_t</a> must also be in little-endian order.<br />
 Use <a class="el" href="group__group__crypto__cli__functions.html#gabd4ba58c8fef2e5dc952995774cfb760">Cy_Crypto_InvertEndianness</a> function to convert to or from little-endian order.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pubKey</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__rsa__pub__key__t.html">cy_stc_crypto_rsa_pub_key_t</a> structure that stores public key.</td></tr>
    <tr><td class="paramname">message</td><td>The pointer to the message to be processed. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">messageSize</td><td>The length of the message to be processed.</td></tr>
    <tr><td class="paramname">processedMessage</td><td>The pointer to processed message. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__rsa__t.html">cy_stc_crypto_context_rsa_t</a> structure that stores the RSA context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="gaf7d03e6a13f42bae1fbbcf6c05730129"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf7d03e6a13f42bae1fbbcf6c05730129">&#9670;&nbsp;</a></span>Cy_Crypto_Rsa_CalcCoefs()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Rsa_CalcCoefs </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__rsa__pub__key__t.html">cy_stc_crypto_rsa_pub_key_t</a> const *&#160;</td>
          <td class="paramname"><em>pubKey</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__rsa__t.html">cy_stc_crypto_context_rsa_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function calculates constant coefficients (which is dependent only on modulo and independent on message). </p>
<p>With this pre-calculated coefficients calculations speed-up by five times.</p>
<p>These coefficients are: coefficient for Barrett reduction, binary inverse of the modulo, result of (2^moduloLength mod modulo)</p>
<p>Calculated coefficients will be placed by addresses provided in the pubKey structure for according coefficients. Function overwrites previous values. Approximate performance for 1024-bit modulo is 33.2 ms; for 2048-bit modulo is 113 ms when using a 25 MHz clock for Crypto HW. These numbers are just for reference. They depend on many factors (compiler, optimization level, etc.).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pubKey</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__rsa__pub__key__t.html">cy_stc_crypto_rsa_pub_key_t</a> structure that stores a public key.</td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__rsa__t.html">cy_stc_crypto_context_rsa_t</a> structure that stores the RSA context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="gaeb5b9b79cbdb1e4b45dce7a27e269b5c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaeb5b9b79cbdb1e4b45dce7a27e269b5c">&#9670;&nbsp;</a></span>Cy_Crypto_Rsa_Verify()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Rsa_Verify </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__crypto__enums.html#gaf08f93b8b21962a60f119157337b2113">cy_en_crypto_rsa_ver_result_t</a> *&#160;</td>
          <td class="paramname"><em>verResult</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__crypto__enums.html#ga66ead9efce36e261e978cad722bf2dbb">cy_en_crypto_sha_mode_t</a>&#160;</td>
          <td class="paramname"><em>digestType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t const *&#160;</td>
          <td class="paramname"><em>digest</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t const *&#160;</td>
          <td class="paramname"><em>decryptedSignature</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>decryptedSignatureLength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__rsa__ver__t.html">cy_stc_crypto_context_rsa_ver_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function does an RSA verification with checks for content, paddings, and signature format. </p>
<p>The SHA digest of the message and decrypted message should be calculated first. Supports only PKCS1-v1_5 format. Inside of this format supported padding using only SHA. Cases with MD2 and MD5 are not supported.</p>
<p>PKCS1-v1_5 described here, page 31: <a href="http://www.emc.com/collateral/white-papers/h11300-pkcs-1v2-2-rsa-cryptography-standard-wp.pdf">http://www.emc.com/collateral/white-papers/h11300-pkcs-1v2-2-rsa-cryptography-standard-wp.pdf</a></p>
<p>Returns the verification result <a class="el" href="group__group__crypto__enums.html#gaf08f93b8b21962a60f119157337b2113">cy_en_crypto_rsa_ver_result_t</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">verResult</td><td>The pointer to the verification result <a class="el" href="group__group__crypto__enums.html#gaf08f93b8b21962a60f119157337b2113">cy_en_crypto_rsa_ver_result_t</a>.</td></tr>
    <tr><td class="paramname">digestType</td><td>SHA mode used for hash calculation <a class="el" href="group__group__crypto__enums.html#ga66ead9efce36e261e978cad722bf2dbb">cy_en_crypto_sha_mode_t</a>.</td></tr>
    <tr><td class="paramname">digest</td><td>The pointer to the hash of the message whose signature is to be verified. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">decryptedSignature</td><td>The pointer to the decrypted signature to be verified. <b>Must be 4-byte aligned.</b></td></tr>
    <tr><td class="paramname">decryptedSignatureLength</td><td>The length of the decrypted signature to be verified (in bytes)</td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__rsa__ver__t.html">cy_stc_crypto_context_rsa_ver_t</a> structure that stores the RSA context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
<a id="ga82ae96bd17e206306bd8e7b5f09de17a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga82ae96bd17e206306bd8e7b5f09de17a">&#9670;&nbsp;</a></span>Cy_Crypto_ECDSA_SignHash()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_ECDSA_SignHash </td>
          <td>(</td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>hash</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>hashlen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>sig</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcy__stc__crypto__ecc__key.html">cy_stc_crypto_ecc_key</a> *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>messageKey</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__ecc__t.html">cy_stc_crypto_context_ecc_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sign a message digest. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hash</td><td>The message digest to sign. Provided as is in data buffer.</td></tr>
    <tr><td class="paramname">hashlen</td><td>The length of the digest in bytes.</td></tr>
    <tr><td class="paramname">sig</td><td>[out] The destination for the signature, 'R' followed by 'S'.</td></tr>
    <tr><td class="paramname">key</td><td>Key used for signature generation. See <a class="el" href="structcy__stc__crypto__ecc__key.html">cy_stc_crypto_ecc_key</a>.</td></tr>
    <tr><td class="paramname">messageKey</td><td>Message key.</td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__ecc__t.html">cy_stc_crypto_context_ecc_t</a> structure that stores the ECC operation context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>status code. See <a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>. </dd></dl>

</div>
</div>
<a id="ga516a14dbdb8e2bd757311017e5a7cf20"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga516a14dbdb8e2bd757311017e5a7cf20">&#9670;&nbsp;</a></span>Cy_Crypto_ECDSA_VerifyHash()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_ECDSA_VerifyHash </td>
          <td>(</td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>sig</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>hash</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>hashlen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>stat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcy__stc__crypto__ecc__key.html">cy_stc_crypto_ecc_key</a> *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__context__ecc__t.html">cy_stc_crypto_context_ecc_t</a> *&#160;</td>
          <td class="paramname"><em>cfContext</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Verify an ECC signature. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sig</td><td>The signature to verify, 'R' followed by 'S'.</td></tr>
    <tr><td class="paramname">hash</td><td>The message digest that was signed. Provided as is in data buffer.</td></tr>
    <tr><td class="paramname">hashlen</td><td>The length of the digest in bytes.</td></tr>
    <tr><td class="paramname">stat</td><td>Result of signature, 1==valid, 0==invalid.</td></tr>
    <tr><td class="paramname">key</td><td>The corresponding public ECC key. See <a class="el" href="structcy__stc__crypto__ecc__key.html">cy_stc_crypto_ecc_key</a>.</td></tr>
    <tr><td class="paramname">cfContext</td><td>The pointer to the <a class="el" href="structcy__stc__crypto__context__ecc__t.html">cy_stc_crypto_context_ecc_t</a> structure that stores the ECC operation context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>status code. See <a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>. </dd></dl>

</div>
</div>
<a id="gabd4ba58c8fef2e5dc952995774cfb760"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabd4ba58c8fef2e5dc952995774cfb760">&#9670;&nbsp;</a></span>Cy_Crypto_InvertEndianness()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_Crypto_InvertEndianness </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>inArrPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>byteSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function reverts byte-array memory block, like:<br />
 inArr[0] &lt;&mdash;&gt; inArr[n]<br />
 inArr[1] &lt;&mdash;&gt; inArr[n-1]<br />
 inArr[2] &lt;&mdash;&gt; inArr[n-2]<br />
 ........................<br />
 inArr[n/2] &lt;&mdash;&gt; inArr[n/2-1]<br />
 </p>
<p>Odd or even byteSize are acceptable.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">inArrPtr</td><td>The pointer to the memory whose endianness is to be inverted.</td></tr>
    <tr><td class="paramname">byteSize</td><td>The length of the memory array whose endianness is to be inverted (in bytes) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
